1 /** 2 Copyright by The HDF Group. * 3 Copyright by the Board of Trustees of the University of Illinois. * 4 All rights reserved. * 5 * 6 This file is part of HDF5. The full HDF5 copyright notice, including * 7 terms governing use, modification, and redistribution, is contained in * 8 the files COPYING and Copyright.html. COPYING can be found at the root * 9 of the source code distribution tree; Copyright.html can be found at the * 10 root level of an installed copy of the electronic HDF5 document set and * 11 is linked from the top-level documents page. It can also be found at * 12 http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * 13 access to either file, you may request a copy from help@hdfgroup.org. * 14 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 15 Ported to D by Laeeth Isharc 2014 16 Borrowed heavily in terms of C API declarations from https://github.com/SFrijters/hdf5-d 17 Stefan Frijters bindings for D 18 19 I do not think these are complete, and I also wanted to begin to work on a higher level D 20 interface. Initially just using strings instead of chars, for example. And exceptions 21 instead of checking status code each time. Later will add a higher level interface similarly 22 to how it is done in h5py. 23 24 Consider this not even alpha stage. It probably isn't so far away from being useful though. 25 This is written for Linux and will need modification to work on other platforms. 26 27 28 To Do: 29 1. Better exception handling that calls HDF5 to get error and returns appropriate Throwable object 30 2. Unit tests 31 3. Thoughtfulness about using D CFTE/reflection/templating to make it work better - also variants etc 32 should be able to pass the data structure not cast(ubyte*) 33 should automatically use reflection to deal with structs etc 34 */ 35 36 module hdf5; 37 public import core.stdc.stdint; 38 public import core.sys.posix.sys.types: off_t; 39 public import core.stdc.time; 40 public import core.stdc.stdint; 41 import std.conv; 42 import std..string; 43 import std.array; 44 import std.stdio; 45 46 enum h5parallel=0; 47 48 void throwOnError(int status) 49 { 50 if (status>=0) 51 return; 52 else 53 throw new Exception("HDF5 error - check message"); 54 } 55 56 enum H5_VERS_MAJOR = 1; /* For major interface/format changes */ 57 enum H5_VERS_MINOR = 8; /* For minor interface/format changes */ 58 enum H5_VERS_RELEASE = 14; /* For tweaks, bug-fixes, or development */ 59 enum H5_VERS_SUBRELEASE = ""; /* For pre-releases like snap0 */ 60 /* Empty string for real releases. */ 61 enum H5_VERS_INFO = "HDF5 library version: 1.8.14"; /* Full version string */ 62 63 auto H5check() { 64 return H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, H5_VERS_RELEASE); 65 } 66 67 /* macros for comparing the version */ 68 bool H5_VERSION_GE(Maj,Min,Rel)() { 69 return (((H5_VERS_MAJOR==Maj) && (H5_VERS_MINOR==Min) && (H5_VERS_RELEASE>=Rel)) || 70 ((H5_VERS_MAJOR==Maj) && (H5_VERS_MINOR>Min)) || 71 (H5_VERS_MAJOR>Maj)); 72 } 73 74 bool H5_VERSION_LE(Maj,Min,Rel)() { 75 return (((H5_VERS_MAJOR==Maj) && (H5_VERS_MINOR==Min) && (H5_VERS_RELEASE<=Rel)) || 76 ((H5_VERS_MAJOR==Maj) && (H5_VERS_MINOR<Min)) || 77 (H5_VERS_MAJOR<Maj)); 78 } 79 alias herr_t = int; 80 alias hbool_t = uint; 81 alias htri_t = int; 82 83 static if ( H5_SIZEOF_SIZE_T==H5_SIZEOF_INT ) { 84 alias ssize_t = int; 85 } 86 else static if ( H5_SIZEOF_SIZE_T==H5_SIZEOF_LONG ) { 87 alias ssize_t = long; 88 } 89 else static if ( H5_SIZEOF_SIZE_T==H5_SIZEOF_LONG_LONG ) { 90 alias ssize_t = long; 91 } 92 else { 93 static assert(0, "nothing appropriate for ssize_t"); 94 } 95 96 alias hsize_t = ulong; 97 alias hssize_t = long; 98 99 static if (H5_SIZEOF_INT64_T >= 8 ) { 100 alias haddr_t = uint64_t; 101 enum HADDR_UNDEF = ( cast(haddr_t) cast(int64_t)(-1)); 102 enum H5_SIZEOF_HADDR_T = H5_SIZEOF_INT64_T; 103 enum HADDR_AS_MPI_TYPE = MPI_LONG_LONG_INT; 104 } 105 else static if (H5_SIZEOF_INT >= 8 ) { 106 alias haddr_t = uint; 107 enum HADDR_UNDEF = (cast(haddr_t)(-1)); 108 enum H5_SIZEOF_HADDR_T = H5_SIZEOF_INT; 109 enum HADDR_AS_MPI_TYPE = MPI_UNSIGNED; 110 } 111 else static if (H5_SIZEOF_LONG >= 8 ) { 112 alias haddr_t = ulong; 113 enum HADDR_UNDEF = (cast(haddr_t) cast(long)(-1)); 114 enum H5_SIZEOF_HADDR_T = H5_SIZEOF_LONG; 115 enum HADDR_AS_MPI_TYPE = MPI_UNSIGNED_LONG; 116 } 117 else static if (H5_SIZEOF_LONG_LONG >= 8 ) { 118 alias haddr_t = ulong; 119 enum HADDR_UNDEF = (cast(haddr_t) cast(long)(-1)); 120 enum H5_SIZEOF_HADDR_T = H5_SIZEOF_LONG_LONG; 121 enum HADDR_AS_MPI_TYPE = MPI_LONG_LONG_INT; 122 } 123 else { 124 static assert(0, "nothing appropriate for haddr_t"); 125 } 126 127 static if ( H5_SIZEOF_UINT64_T>=8 ) { } 128 else static if ( H5_SIZEOF_INT>=8 ) { 129 alias uint64_t = uint; 130 enum H5_SIZEOF_UINT64_T = H5_SIZEOF_INT; 131 } 132 else static if ( H5_SIZEOF_LONG>=8 ) { 133 alias uint64_t = uint; 134 enum H5_SIZEOF_UINT64_T = H5_SIZEOF_LONG; 135 } 136 else static if ( H5_SIZEOF_LONG_LONG>=8 ) { 137 alias uint64_t = ulong; 138 enum H5_SIZEOF_UINT64_T = H5_SIZEOF_LONG_LONG; 139 } 140 else { 141 static assert(0, "nothing appropriate for uint64_t"); 142 } 143 144 /* Default value for all property list classes */ 145 enum H5P_DEFAULT = 0; 146 147 /* Common iteration orders */ 148 enum H5IterOrder 149 { 150 Unknown = -1, /* Unknown order */ 151 Inc, /* Increasing order */ 152 Dec, /* Decreasing order */ 153 Native, /* No particular order, whatever is fastest */ 154 N /* Number of iteration orders */ 155 } 156 157 /* Iteration callback values */ 158 /* (Actually, any postive value will cause the iterator to stop and pass back 159 * that positive value to the function that called the iterator) 160 */ 161 enum H5_ITER_ERROR = (-1); 162 enum H5_ITER_CONT = (0); 163 enum H5_ITER_STOP = (1); 164 165 /* 166 * The types of indices on links in groups/attributes on objects. 167 * Primarily used for "<do> <foo> by index" routines and for iterating over 168 * links in groups/attributes on objects. 169 */ 170 enum H5Index { 171 Unknown = -1, /* Unknown index type */ 172 Name, /* Index on names */ 173 CRTOrder, /* Index on creation order */ 174 N /* Number of indices defined */ 175 } 176 177 /* 178 * Storage info struct used by H5O_info_t and H5F_info_t 179 */ 180 align(1) 181 { 182 struct H5_ih_info_t { 183 hsize_t index_size; /* btree and/or list */ 184 hsize_t heap_size; 185 } 186 } 187 /* Functions in H5.c */ 188 version(Posix) 189 { 190 extern(C) 191 { 192 herr_t H5open(); 193 herr_t H5close(); 194 herr_t H5dont_atexit(); 195 herr_t H5garbage_collect(); 196 herr_t H5set_free_list_limits (int reg_global_lim, int reg_list_lim, 197 int arr_global_lim, int arr_list_lim, int blk_global_lim, int blk_list_lim); 198 herr_t H5get_libversion(uint *majnum, uint *minnum, uint *relnum); 199 herr_t H5check_version(uint majnum, uint minnum, uint relnum); 200 herr_t H5free_memory(void *mem); 201 } 202 } 203 204 string ZtoString(const char[] c) 205 { 206 return to!string(fromStringz(cast(char*)c)); 207 } 208 209 string ZtoString(const char* c) 210 { 211 return to!string(fromStringz(c)); 212 } 213 214 enum H5AC__CURR_CACHE_CONFIG_VERSION =1; 215 enum H5AC__MAX_TRACE_FILE_NAME_LEN =1024; 216 217 enum H5AC_METADATA 218 { 219 WRITE_STRATEGY__PROCESS_0_ONLY =0, 220 WRITE_STRATEGY__DISTRIBUTED =1, 221 } 222 struct H5ACCacheConfig 223 { 224 align(1) 225 { 226 /* general configuration fields: */ 227 int ver; 228 229 hbool_t rpt_fcn_enabled; 230 231 hbool_t open_trace_file; 232 hbool_t close_trace_file; 233 char[H5AC__MAX_TRACE_FILE_NAME_LEN + 1] trace_file_name; 234 235 hbool_t evictions_enabled; 236 237 hbool_t set_initial_size; 238 size_t initial_size; 239 240 double min_clean_fraction; 241 242 size_t max_size; 243 size_t min_size; 244 245 long epoch_length; 246 247 248 /* size increase control fields: */ 249 //enum H5C_cache_incr_mode=incr_mode; 250 251 double lower_hr_threshold; 252 253 double increment; 254 255 hbool_t apply_max_increment; 256 size_t max_increment; 257 258 //enum H5C_cache_flash_incr_mode =flash_incr_mode; 259 double flash_multiple; 260 double flash_threshold; 261 262 263 /* size decrease control fields: */ 264 //enum H5C_cache_decr_mode decr_mode; 265 266 double upper_hr_threshold; 267 268 double decrement; 269 270 hbool_t apply_max_decrement; 271 size_t max_decrement; 272 273 int epochs_before_eviction; 274 275 hbool_t apply_empty_reserve; 276 double empty_reserve; 277 278 279 /* parallel configuration fields: */ 280 int dirty_bytes_threshold; 281 int metadata_write_strategy; 282 } 283 } 284 285 286 287 288 /*****************/ 289 /* Public Macros */ 290 /*****************/ 291 292 /* Macros used to "unset" chunk cache configuration parameters */ 293 enum H5D_CHUNK_CACHE_NSLOTS_DEFAULT = (cast(size_t) -1); 294 enum H5D_CHUNK_CACHE_NBYTES_DEFAULT = (cast(size_t) -1); 295 enum H5D_CHUNK_CACHE_W0_DEFAULT = -1.; 296 297 /* Property names for H5LTDdirect_chunk_write */ 298 enum H5D_XFER_DIRECT_CHUNK_WRITE_FLAG_NAME = "direct_chunk_flag"; 299 enum H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_NAME = "direct_chunk_filters"; 300 enum H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_NAME = "direct_chunk_offset"; 301 enum H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_NAME = "direct_chunk_datasize"; 302 303 /*******************/ 304 /* Public Typedefs */ 305 /*******************/ 306 307 /* Values for the H5D_LAYOUT property */ 308 enum H5DLayout 309 { 310 Error = -1, 311 312 Compact = 0, /*raw data is very small */ 313 Contiguous = 1, /*the default */ 314 Chunked = 2, /*slow and fancy */ 315 Nlayouts = 3 /*this one must be last! */ 316 } 317 318 /* Types of chunk index data structures */ 319 enum H5D_chunk_index_t { 320 H5D_CHUNK_BTREE = 0 /* v1 B-tree index */ 321 } 322 323 /* Values for the space allocation time property */ 324 enum H5DAllocTime { 325 Error = -1, 326 Default = 0, 327 Early = 1, 328 Late = 2, 329 Incr = 3 330 } 331 332 /* Values for the status of space allocation */ 333 enum H5DSpaceStatus 334 { 335 Error = -1, 336 NotAllocated = 0, 337 PartAllocated = 1, 338 Allocated = 2 339 } 340 341 /* Values for time of writing fill value property */ 342 enum H5D_fill_time_t { 343 H5D_FILL_TIME_ERROR = -1, 344 H5D_FILL_TIME_ALLOC = 0, 345 H5D_FILL_TIME_NEVER = 1, 346 H5D_FILL_TIME_IFSET = 2 347 } 348 349 /* Values for fill value status */ 350 enum H5D_fill_value_t { 351 H5D_FILL_VALUE_ERROR =-1, 352 H5D_FILL_VALUE_UNDEFINED =0, 353 H5D_FILL_VALUE_DEFAULT =1, 354 H5D_FILL_VALUE_USER_DEFINED =2 355 } 356 357 /*********************/ 358 /* Public Prototypes */ 359 /*********************/ 360 361 /* Define the operator function pointer for H5Diterate() */ 362 extern(C) 363 { 364 alias H5D_operator_t = herr_t function(void *elem, hid_t type_id, int ndim, const hsize_t *point, void *operator_data); 365 /* Define the operator function pointer for H5Dscatter() */ 366 alias H5D_scatter_func_t = herr_t function(const void **src_buf/*out*/, size_t *src_buf_bytes_used/*out*/, void *op_data); 367 /* Define the operator function pointer for H5Dgather() */ 368 alias H5D_gather_func_t = herr_t function(const void *dst_buf, size_t dst_buf_bytes_used, void *op_data); 369 version(Posix) { 370 hid_t H5Dcreate2(hid_t loc_id, const char *name, hid_t type_id, 371 hid_t space_id, hid_t lcpl_id, hid_t dcpl_id, hid_t dapl_id); 372 hid_t H5Dcreate_anon(hid_t file_id, hid_t type_id, hid_t space_id, hid_t plist_id, hid_t dapl_id); 373 hid_t H5Dopen2(hid_t file_id, const char *name, hid_t dapl_id); 374 herr_t H5Dclose(hid_t dset_id); 375 hid_t H5Dget_space(hid_t dset_id); 376 herr_t H5Dget_space_status(hid_t dset_id, H5DSpaceStatus *allocation); 377 hid_t H5Dget_type(hid_t dset_id); 378 hid_t H5Dget_create_plist(hid_t dset_id); 379 hid_t H5Dget_access_plist(hid_t dset_id); 380 hsize_t H5Dget_storage_size(hid_t dset_id); 381 haddr_t H5Dget_offset(hid_t dset_id); 382 herr_t H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, hid_t plist_id, void *buf/*out*/); 383 herr_t H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, hid_t plist_id, const void *buf); 384 herr_t H5Diterate(void *buf, hid_t type_id, hid_t space_id, H5D_operator_t op, void *operator_data); 385 herr_t H5Dvlen_reclaim(hid_t type_id, hid_t space_id, hid_t plist_id, void *buf); 386 herr_t H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, hsize_t *size); 387 herr_t H5Dfill(const void *fill, hid_t fill_type, void *buf, hid_t buf_type, hid_t space); 388 herr_t H5Dset_extent(hid_t dset_id, const hsize_t* size); 389 herr_t H5Dscatter(H5D_scatter_func_t op, void *op_data, hid_t type_id, hid_t dst_space_id, void *dst_buf); 390 herr_t H5Dgather(hid_t src_space_id, const void *src_buf, hid_t type_id, size_t dst_buf_size, void *dst_buf, H5D_gather_func_t op, void *op_data); 391 herr_t H5Ddebug(hid_t dset_id); 392 } 393 394 395 396 /* Information struct for attribute (for H5Aget_info/H5Aget_info_by_idx) */ 397 align(1) 398 { 399 struct H5A_info_t { 400 hbool_t corder_valid; /* Indicate if creation order is valid */ 401 H5O_msg_crt_idx_t corder; /* Creation order */ 402 H5TCset cset; /* Character set of attribute name */ 403 hsize_t data_size; /* Size of raw data */ 404 } 405 } 406 // Typedef for H5Aiterate2() callbacks 407 extern(C) 408 { 409 alias H5A_operator2_t = herr_t function(hid_t location_id/*in*/, const char *attr_name/*in*/, const H5A_info_t *ainfo/*in*/, void *op_data/*in,out*/); 410 } 411 version(Posix) 412 { 413 extern(C) 414 { 415 // Public function prototypes 416 417 hid_t H5Acreate2(hid_t loc_id, const char *attr_name, hid_t type_id, hid_t space_id, hid_t acpl_id, hid_t aapl_id); 418 hid_t H5Acreate_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, 419 hid_t type_id, hid_t space_id, hid_t acpl_id, hid_t aapl_id, hid_t lapl_id); 420 hid_t H5Aopen(hid_t obj_id, const char *attr_name, hid_t aapl_id); 421 hid_t H5Aopen_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hid_t aapl_id, hid_t lapl_id); 422 hid_t H5Aopen_by_idx(hid_t loc_id, const char *obj_name, H5Index idx_type, H5IterOrder order, hsize_t n, hid_t aapl_id, 423 hid_t lapl_id); 424 herr_t H5Awrite(hid_t attr_id, hid_t type_id, const void *buf); 425 herr_t H5Aread(hid_t attr_id, hid_t type_id, void *buf); 426 herr_t H5Aclose(hid_t attr_id); 427 hid_t H5Aget_space(hid_t attr_id); 428 hid_t H5Aget_type(hid_t attr_id); 429 hid_t H5Aget_create_plist(hid_t attr_id); 430 ssize_t H5Aget_name(hid_t attr_id, size_t buf_size, char *buf); 431 ssize_t H5Aget_name_by_idx(hid_t loc_id, const char *obj_name, H5Index idx_type, H5IterOrder order, hsize_t n, 432 char *name /*out*/, size_t size, hid_t lapl_id); 433 hsize_t H5Aget_storage_size(hid_t attr_id); 434 herr_t H5Aget_info(hid_t attr_id, H5A_info_t *ainfo /*out*/); 435 herr_t H5Aget_info_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, H5A_info_t *ainfo /*out*/, hid_t lapl_id); 436 herr_t H5Aget_info_by_idx(hid_t loc_id, const char *obj_name, H5Index idx_type, H5IterOrder order, hsize_t n, 437 H5A_info_t *ainfo /*out*/, hid_t lapl_id); 438 herr_t H5Arename(hid_t loc_id, const char *old_name, const char *new_name); 439 herr_t H5Arename_by_name(hid_t loc_id, const char *obj_name, const char *old_attr_name, const char *new_attr_name, hid_t lapl_id); 440 herr_t H5Aiterate2(hid_t loc_id, H5Index idx_type, H5IterOrder order, hsize_t *idx, H5A_operator2_t op, void *op_data); 441 herr_t H5Aiterate_by_name(hid_t loc_id, const char *obj_name, H5Index idx_type, H5IterOrder order, hsize_t *idx, 442 H5A_operator2_t op, void *op_data, hid_t lapd_id); 443 herr_t H5Adelete(hid_t loc_id, const char *name); 444 herr_t H5Adelete_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hid_t lapl_id); 445 herr_t H5Adelete_by_idx(hid_t loc_id, const char *obj_name, H5Index idx_type, H5IterOrder order, hsize_t n, hid_t lapl_id); 446 htri_t H5Aexists(hid_t obj_id, const char *attr_name); 447 htri_t H5Aexists_by_name(hid_t obj_id, const char *obj_name, const char *attr_name, hid_t lapl_id); 448 } 449 } 450 451 452 enum H5D_ONE_LINK_CHUNK_IO_THRESHOLD = 0; 453 enum H5D_MULTI_CHUNK_IO_COL_THRESHOLD = 60; 454 enum H5FDMPIO { 455 Independent = 0, /*zero is the default*/ 456 Collective 457 } 458 459 /* Type of chunked dataset I/O */ 460 enum H5FDMPIOChunkOptions 461 { 462 Default = 0, 463 OneIO, /*zero is the default*/ 464 MultiIO 465 } 466 467 /* Type of collective I/O */ 468 469 alias H5FD_MPIO=H5FD_mpio_init; 470 471 472 473 static if (H5_HAVE_PARALLEL) 474 { 475 enum H5F_DEBUG = true; 476 } 477 478 /* Global var whose value comes from environment variable */ 479 /* (Defined in H5FDmpio.c) */ 480 extern __gshared hbool_t H5FD_mpi_opt_types_g; 481 482 version(Posix) { 483 484 /* Function prototypes */ 485 hid_t H5FD_mpio_init(); 486 void H5FD_mpio_term(); 487 herr_t H5Pset_fapl_mpio(hid_t fapl_id, MPI_Comm comm, MPI_Info info); 488 herr_t H5Pget_fapl_mpio(hid_t fapl_id, MPI_Comm *comm/*out*/, MPI_Info *info/*out*/); 489 herr_t H5Pset_dxpl_mpio(hid_t dxpl_id, H5FDMPIO xfer_mode); 490 herr_t H5Pget_dxpl_mpio(hid_t dxpl_id, H5FDMPIO *xfer_mode/*out*/); 491 herr_t H5Pset_dxpl_mpio_collective_opt(hid_t dxpl_id, H5FDMPIO opt_mode); 492 herr_t H5Pset_dxpl_mpio_chunk_opt(hid_t dxpl_id, H5FDMPIOChunkOptions opt_mode); 493 herr_t H5Pset_dxpl_mpio_chunk_opt_num(hid_t dxpl_id, uint num_chunk_per_proc); 494 herr_t H5Pset_dxpl_mpio_chunk_opt_ratio(hid_t dxpl_id, uint percent_num_proc_per_chunk); 495 } 496 } 497 498 499 500 /* 501 * These are the bits that can be passed to the `flags' argument of 502 * H5Fcreate() and H5Fopen(). Use the bit-wise OR operator (|) to combine 503 * them as needed. As a side effect, they call H5check_version() to make sure 504 * that the application is compiled with a version of the hdf5 header files 505 * which are compatible with the library to which the application is linked. 506 * We're assuming that these constants are used rather early in the hdf5 507 * session. 508 * 509 */ 510 enum H5F_ACC_RDONLY = 0x0000u; /*absence of rdwr => rd-only */ 511 enum H5F_ACC_RDWR = 0x0001u; /*open for read and write */ 512 enum H5F_ACC_TRUNC = 0x0002u; /*overwrite existing files */ 513 enum H5F_ACC_EXCL = 0x0004u; /*fail if file already exists*/ 514 enum H5F_ACC_DEBUG = 0x0008u; /*print debug info */ 515 enum H5F_ACC_CREAT = 0x0010u; /*create non-existing files */ 516 517 /* Value passed to H5Pset_elink_acc_flags to cause flags to be taken from the 518 * parent file. */ 519 enum H5F_ACC_DEFAULT = 0xffffu; /*ignore setting on lapl */ 520 521 /* Flags for H5Fget_obj_count() & H5Fget_obj_ids() calls */ 522 enum H5F_OBJ_FILE = 0x0001u; /* File objects */ 523 enum H5F_OBJ_DATASET = 0x0002u; /* Dataset objects */ 524 enum H5F_OBJ_GROUP = 0x0004u; /* Group objects */ 525 enum H5F_OBJ_DATATYPE= 0x0008u; /* Named datatype objects */ 526 enum H5F_OBJ_ATTR = 0x0010u; /* Attribute objects */ 527 enum H5F_OBJ_ALL = (H5F_OBJ_FILE|H5F_OBJ_DATASET|H5F_OBJ_GROUP|H5F_OBJ_DATATYPE|H5F_OBJ_ATTR); 528 enum H5F_OBJ_LOCAL = 0x0020u; /* Restrict search to objects opened through current file ID */ 529 /* (as opposed to objects opened through any file ID accessing this file) */ 530 531 532 enum H5F_FAMILY_DEFAULT = cast(hsize_t) 0; 533 534 /* 535 * Use this constant string as the MPI_Info key to set H5Fmpio debug flags. 536 * To turn on H5Fmpio debug flags, set the MPI_Info value with this key to 537 * have the value of a string consisting of the characters that turn on the 538 * desired flags. 539 */ 540 enum H5F_MPIO_DEBUG_KEY = "H5F_mpio_debug_key"; 541 542 /* The difference between a single file and a set of mounted files */ 543 enum H5F_scope_t { 544 H5F_SCOPE_LOCAL = 0, /*specified file handle only */ 545 H5F_SCOPE_GLOBAL = 1 /*entire virtual file */ 546 } 547 548 /* Unlimited file size for H5Pset_external() */ 549 enum H5F_UNLIMITED = (cast(hsize_t)(-1L)); 550 551 /* How does file close behave? 552 * H5F_CLOSE_DEFAULT - Use the degree pre-defined by underlining VFL 553 * H5F_CLOSE_WEAK - file closes only after all opened objects are closed 554 * H5F_CLOSE_SEMI - if no opened objects, file is close; otherwise, file 555 close fails 556 * H5F_CLOSE_STRONG - if there are opened objects, close them first, then 557 close file 558 */ 559 enum H5F_close_degree_t { 560 H5F_CLOSE_DEFAULT = 0, 561 H5F_CLOSE_WEAK = 1, 562 H5F_CLOSE_SEMI = 2, 563 H5F_CLOSE_STRONG = 3 564 } 565 566 /* Current "global" information about file */ 567 /* (just size info currently) */ 568 align(1) 569 { 570 struct H5F_info_t { 571 hsize_t super_ext_size; /* Superblock extension size */ 572 struct { 573 hsize_t hdr_size; /* Shared object header message header size */ 574 H5_ih_info_t msgs_info; /* Shared object header message index & heap size */ 575 }; 576 } 577 } 578 579 /* 580 * Types of allocation requests. The values larger than H5FD_MEM_DEFAULT 581 * should not change other than adding new types to the end. These numbers 582 * might appear in files. 583 * 584 * Note: please change the log VFD flavors array if you change this 585 * enumeration. 586 */ 587 enum H5F_mem_t { 588 H5FD_MEM_NOLIST = -1, /* Data should not appear in the free list. 589 * Must be negative. 590 */ 591 H5FD_MEM_DEFAULT = 0, /* Value not yet set. Can also be the 592 * datatype set in a larger allocation 593 * that will be suballocated by the library. 594 * Must be zero. 595 */ 596 H5FD_MEM_SUPER = 1, /* Superblock data */ 597 H5FD_MEM_BTREE = 2, /* B-tree data */ 598 H5FD_MEM_DRAW = 3, /* Raw data (content of datasets, etc.) */ 599 H5FD_MEM_GHEAP = 4, /* Global heap data */ 600 H5FD_MEM_LHEAP = 5, /* Local heap data */ 601 H5FD_MEM_OHDR = 6, /* Object header data */ 602 603 H5FD_MEM_NTYPES /* Sentinel value - must be last */ 604 } 605 606 /* Library's file format versions */ 607 enum H5F_libver_t { 608 H5F_LIBVER_EARLIEST, /* Use the earliest possible format for storing objects */ 609 H5F_LIBVER_LATEST /* Use the latest possible format available for storing objects*/ 610 } 611 612 /* Define file format version for 1.8 to prepare for 1.10 release. 613 * (Not used anywhere now)*/ 614 // #define H5F_LIBVER_18 H5F_LIBVER_LATEST 615 616 /* Functions in H5F.c */ 617 version(Posix) { 618 extern(C) 619 { 620 htri_t H5Fis_hdf5(const char *filename); 621 hid_t H5Fcreate(const char *filename, uint flags, hid_t create_plist, hid_t access_plist); 622 hid_t H5Fopen(const char *filename, uint flags, hid_t access_plist); 623 hid_t H5Freopen(hid_t file_id); 624 herr_t H5Fflush(hid_t object_id, H5F_scope_t _scope); 625 herr_t H5Fclose(hid_t file_id); 626 hid_t H5Fget_create_plist(hid_t file_id); 627 hid_t H5Fget_access_plist(hid_t file_id); 628 herr_t H5Fget_intent(hid_t file_id, uint * intent); 629 ssize_t H5Fget_obj_count(hid_t file_id, uint types); 630 ssize_t H5Fget_obj_ids(hid_t file_id, uint types, size_t max_objs, hid_t *obj_id_list); 631 herr_t H5Fget_vfd_handle(hid_t file_id, hid_t fapl, void **file_handle); 632 herr_t H5Fmount(hid_t loc, const char *name, hid_t child, hid_t plist); 633 herr_t H5Funmount(hid_t loc, const char *name); 634 hssize_t H5Fget_freespace(hid_t file_id); 635 herr_t H5Fget_filesize(hid_t file_id, hsize_t *size); 636 ssize_t H5Fget_file_image(hid_t file_id, void * buf_ptr, size_t buf_len); 637 herr_t H5Fget_mdc_hit_rate(hid_t file_id, double * hit_rate_ptr); 638 herr_t H5Fget_mdc_size(hid_t file_id, size_t * max_size_ptr, size_t * min_clean_size_ptr, size_t * cur_size_ptr, int * cur_num_entries_ptr); 639 herr_t H5Freset_mdc_hit_rate_stats(hid_t file_id); 640 ssize_t H5Fget_name(hid_t obj_id, char *name, size_t size); 641 herr_t H5Fget_info(hid_t obj_id, H5F_info_t *bh_info); 642 herr_t H5Fclear_elink_file_cache(hid_t file_id); 643 version(h5parallel) herr_t H5Fset_mpi_atomicity(hid_t file_id, hbool_t flag); 644 version(h5parallel) herr_t H5Fget_mpi_atomicity(hid_t file_id, hbool_t *flag); 645 } 646 } 647 648 enum H5GStorageType { 649 Unknown = -1, /* Unknown link storage type */ 650 SymbolTable, /* Links in group are stored with a "symbol table" */ 651 /* (this is sometimes called "old-style" groups) */ 652 Compact, /* Links are stored in object header */ 653 Dense /* Links are stored in fractal heap & indexed with v2 B-tree */ 654 } 655 656 /* Information struct for group (for H5Gget_info/H5Gget_info_by_name/H5Gget_info_by_idx) */ 657 struct H5GInfo { 658 align(1) 659 { 660 H5GStorageType storage_type; /* Type of storage for links in group */ 661 hsize_t nlinks; /* Number of links in group */ 662 long max_corder; /* Current max. creation order value for group */ 663 hbool_t mounted; /* Whether group has a file mounted on it */ 664 } 665 } 666 667 extern(C) 668 { 669 hid_t H5Gcreate2(hid_t loc_id, const char *name, hid_t lcpl_id, hid_t gcpl_id, hid_t gapl_id); 670 hid_t H5Gcreate_anon(hid_t loc_id, hid_t gcpl_id, hid_t gapl_id); 671 hid_t H5Gopen2(hid_t loc_id, const char *name, hid_t gapl_id); 672 hid_t H5Gget_create_plist(hid_t group_id); 673 herr_t H5Gget_info(hid_t loc_id, H5GInfo *ginfo); 674 herr_t H5Gget_info_by_name(hid_t loc_id, const(char *)name, H5GInfo *ginfo, hid_t lapl_id); 675 herr_t H5Gget_info_by_idx(hid_t loc_id, const(char *)group_name, H5Index idx_type, H5IterOrder order, hsize_t n, H5GInfo *ginfo, hid_t lapl_id); 676 herr_t H5Gclose(hid_t group_id); 677 } 678 679 /* 680 * Library type values. Start with `1' instead of `0' because it makes the 681 * tracing output look better when hid_t values are large numbers. Change the 682 * TYPE_BITS in H5I.c if the MAXID gets larger than 32 (an assertion will 683 * fail otherwise). 684 * 685 * When adding types here, add a section to the 'misc19' test in test/tmisc.c 686 * to verify that the H5I{inc|dec|get}_ref() routines work correctly with in. 687 * 688 */ 689 690 enum H5IType 691 { 692 Uninitialized = (-2), /*uninitialized type */ 693 BadID = (-1), /*invalid Type */ 694 FileObject = 1, /*type ID for File objects */ 695 Group, /*type ID for Group objects */ 696 DataType, /*type ID for Datatype objects */ 697 DataSpace, /*type ID for Dataspace objects */ 698 DataSet, /*type ID for Dataset objects */ 699 Attr, /*type ID for Attribute objects */ 700 Reference, /*type ID for Reference objects */ 701 VirtualFileLayer, /*type ID for virtual file layer */ 702 GenericPropClass, /*type ID for generic property list classes */ 703 GenericPropList, /*type ID for generic property lists */ 704 ErrorClass, /*type ID for error classes */ 705 ErrorMsg, /*type ID for error messages */ 706 ErrorStack, /*type ID for error stacks */ 707 Numtypes /*number of library types, MUST BE LAST! */ 708 } 709 710 /* Type of atoms to return to users */ 711 alias hid_t = int; 712 enum H5_SIZEOF_HID_T = H5_SIZEOF_INT; 713 714 /* An invalid object ID. This is also negative for error return. */ 715 enum H5I_INVALID_HID = (-1); 716 717 /* 718 * Function for freeing objects. This function will be called with an object 719 * ID type number and a pointer to the object. The function should free the 720 * object and return non-negative to indicate that the object 721 * can be removed from the ID type. If the function returns negative 722 * (failure) then the object will remain in the ID type. 723 */ 724 extern(C) 725 { 726 alias H5I_free_t = herr_t function(void*); 727 728 /* Type of the function to compare objects & keys */ 729 alias H5I_search_func_t = int function(void *obj, hid_t id, void *key); 730 } 731 //Public API functions 732 733 version(Posix) 734 { 735 extern(C) 736 { 737 hid_t H5Iregister(H5IType type, const void *object); 738 void *H5Iobject_verify(hid_t id, H5IType id_type); 739 void *H5Iremove_verify(hid_t id, H5IType id_type); 740 H5IType H5Iget_type(hid_t id); 741 hid_t H5Iget_file_id(hid_t id); 742 ssize_t H5Iget_name(hid_t id, char *name/*out*/, size_t size); 743 int H5Iinc_ref(hid_t id); 744 int H5Idec_ref(hid_t id); 745 int H5Iget_ref(hid_t id); 746 H5IType H5Iregister_type(size_t hash_size, uint reserved, H5I_free_t free_func); 747 herr_t H5Iclear_type(H5IType type, hbool_t force); 748 herr_t H5Idestroy_type(H5IType type); 749 int H5Iinc_type_ref(H5IType type); 750 int H5Idec_type_ref(H5IType type); 751 int H5Iget_type_ref(H5IType type); 752 void *H5Isearch(H5IType type, H5I_search_func_t func, void *key); 753 herr_t H5Inmembers(H5IType type, hsize_t *num_members); 754 htri_t H5Itype_exists(H5IType type); 755 htri_t H5Iis_valid(hid_t id); 756 } 757 } 758 enum H5L_MAX_LINK_NAME_LEN = (cast(uint32_t)(-1)); /* (4GB - 1) */ 759 enum H5L_SAME_LOC = 0; 760 enum H5L_LINK_CLASS_T_VERS = 0; 761 762 /* Link class types. 763 * Values less than 64 are reserved for the HDF5 library's internal use. 764 * Values 64 to 255 are for "user-defined" link class types; these types are 765 * defined by HDF5 but their behavior can be overridden by users. 766 */ 767 enum H5LType { 768 Error = (-1), /* Invalid link type id */ 769 Hard = 0, /* Hard link id */ 770 Soft = 1, /* Soft link id */ 771 External = 64, /* External link id */ 772 Max = 255 /* Maximum link type id */ 773 }; 774 enum H5L_TYPE_BUILTIN_MAX = H5LType.Soft; /* Maximum value link value for "built-in" link types */ 775 enum H5L_TYPE_UD_MIN = H5LType.External; /* Link ids at or above this value are "user-defined" link types. */ 776 777 /* Information struct for link (for H5Lget_info/H5Lget_info_by_idx) */ 778 struct H5LInfo { 779 H5LType type; /* Type of link */ 780 hbool_t corder_valid; /* Indicate if creation order is valid */ 781 int64_t corder; /* Creation order */ 782 H5TCset cset; /* Character set of link name */ 783 union u { 784 haddr_t address; /* Address hard link points to */ 785 size_t val_size; /* Size of a soft link or UD link value */ 786 }; 787 } 788 789 extern(C) 790 { 791 /* The H5L_class_t struct can be used to override the behavior of a 792 * "user-defined" link class. Users should populate the struct with callback 793 * functions defined below. 794 */ 795 /* Callback prototypes for user-defined links */ 796 /* Link creation callback */ 797 alias H5L_create_func_t = herr_t function(const char *link_name, hid_t loc_group, const void *lnkdata, size_t lnkdata_size, hid_t lcpl_id); 798 799 /* Callback for when the link is moved */ 800 alias H5L_move_func_t = herr_t function(const char *new_name, hid_t new_loc, const void *lnkdata, size_t lnkdata_size); 801 802 /* Callback for when the link is copied */ 803 alias H5L_copy_func_t = herr_t function(const char *new_name, hid_t new_loc, const void *lnkdata, size_t lnkdata_size); 804 805 /* Callback during link traversal */ 806 alias H5L_traverse_func_t = herr_t function(const char *link_name, hid_t cur_group, const void *lnkdata, size_t lnkdata_size, hid_t lapl_id); 807 808 /* Callback for when the link is deleted */ 809 alias H5L_delete_func_t = herr_t function(const char *link_name, hid_t file, const void *lnkdata, size_t lnkdata_size); 810 811 /* Callback for querying the link */ 812 /* Returns the size of the buffer needed */ 813 alias H5L_query_func_t = ssize_t function(const char *link_name, const void *lnkdata, size_t lnkdata_size, void *buf /*out*/, size_t buf_size); 814 815 /* User-defined link types */ 816 struct H5L_class_t { 817 int _version; /* Version number of this struct */ 818 H5LType id; /* Link type ID */ 819 const char *comment; /* Comment for debugging */ 820 H5L_create_func_t create_func; /* Callback during link creation */ 821 H5L_move_func_t move_func; /* Callback after moving link */ 822 H5L_copy_func_t copy_func; /* Callback after copying link */ 823 H5L_traverse_func_t trav_func; /* Callback during link traversal */ 824 H5L_delete_func_t del_func; /* Callback for link deletion */ 825 H5L_query_func_t query_func; /* Callback for queries */ 826 } 827 828 /* Prototype for H5Literate/H5Literate_by_name() operator */ 829 alias H5L_iterate_t = herr_t function(hid_t group, const char *name, const H5LInfo *info, void *op_data); 830 831 /* Callback for external link traversal */ 832 alias H5L_elink_traverse_t = herr_t function(const char *parent_file_name, 833 const char *parent_group_name, const char *child_file_name, 834 const char *child_object_name, uint *acc_flags, hid_t fapl_id, 835 void *op_data); 836 } 837 838 /********************/ 839 /* Public Variables */ 840 /********************/ 841 842 version(Posix) 843 { 844 //Public Prototypes 845 extern(C) 846 { 847 herr_t H5Lmove(hid_t src_loc, const char *src_name, hid_t dst_loc, const char *dst_name, hid_t lcpl_id, hid_t lapl_id); 848 herr_t H5Lcopy(hid_t src_loc, const char *src_name, hid_t dst_loc, const char *dst_name, hid_t lcpl_id, hid_t lapl_id); 849 herr_t H5Lcreate_hard(hid_t cur_loc, const char *cur_name, hid_t dst_loc, const char *dst_name, hid_t lcpl_id, hid_t lapl_id); 850 herr_t H5Lcreate_soft(const char *link_target, hid_t link_loc_id, const char *link_name, hid_t lcpl_id, hid_t lapl_id); 851 herr_t H5Ldelete(hid_t loc_id, const char *name, hid_t lapl_id); 852 herr_t H5Ldelete_by_idx(hid_t loc_id, const char *group_name, H5Index idx_type, H5IterOrder order, hsize_t n, hid_t lapl_id); 853 herr_t H5Lget_val(hid_t loc_id, const char *name, void *buf/*out*/, size_t size, hid_t lapl_id); 854 herr_t H5Lget_val_by_idx(hid_t loc_id, const char *group_name, H5Index idx_type, H5IterOrder order, hsize_t n, void *buf/*out*/, size_t size, hid_t lapl_id); 855 htri_t H5Lexists(hid_t loc_id, const char *name, hid_t lapl_id); 856 herr_t H5Lget_info(hid_t loc_id, const char *name, H5LInfo *linfo /*out*/, hid_t lapl_id); 857 herr_t H5Lget_info_by_idx(hid_t loc_id, const char *group_name, H5Index idx_type, H5IterOrder order, hsize_t n, H5LInfo *linfo /*out*/, hid_t lapl_id); ssize_t H5Lget_name_by_idx(hid_t loc_id, const char *group_name, H5Index idx_type, H5IterOrder order, hsize_t n, char *name /*out*/, size_t size, hid_t lapl_id); 858 herr_t H5Literate(hid_t grp_id, H5Index idx_type, H5IterOrder order, hsize_t *idx, H5L_iterate_t op, void *op_data); 859 herr_t H5Literate_by_name(hid_t loc_id, const char *group_name, H5Index idx_type, H5IterOrder order, hsize_t *idx, H5L_iterate_t op, void *op_data, hid_t lapl_id); 860 herr_t H5Lvisit(hid_t grp_id, H5Index idx_type, H5IterOrder order, H5L_iterate_t op, void *op_data); 861 herr_t H5Lvisit_by_name(hid_t loc_id, const char *group_name, H5Index idx_type, H5IterOrder order, H5L_iterate_t op, void *op_data, hid_t lapl_id); 862 863 /* UD link functions */ 864 herr_t H5Lcreate_ud(hid_t link_loc_id, const char *link_name, H5LType link_type, const void *udata, size_t udata_size, hid_t lcpl_id, hid_t lapl_id); 865 herr_t H5Lregister(const H5L_class_t *cls); 866 herr_t H5Lunregister(H5LType id); 867 htri_t H5Lis_registered(H5LType id); 868 869 /* External link functions */ 870 herr_t H5Lunpack_elink_val(const void *ext_linkval/*in*/, size_t link_size, uint *flags, const char **filename/*out*/, const char **obj_path /*out*/); 871 herr_t H5Lcreate_external(const char *file_name, const char *obj_name, hid_t link_loc_id, const char *link_name, hid_t lcpl_id, hid_t lapl_id); 872 } 873 } 874 875 876 877 extern(C) 878 { 879 880 /*****************/ 881 /* Public Macros */ 882 /*****************/ 883 884 /* Flags for object copy (H5Ocopy) */ 885 enum H5O_COPY_SHALLOW_HIERARCHY_FLAG = (0x0001u); /* Copy only immediate members */ 886 enum H5O_COPY_EXPAND_SOFT_LINK_FLAG = (0x0002u); /* Expand soft links into new objects */ 887 enum H5O_COPY_EXPAND_EXT_LINK_FLAG = (0x0004u); /* Expand external links into new objects */ 888 enum H5O_COPY_EXPAND_REFERENCE_FLAG = (0x0008u); /* Copy objects that are pointed by references */ 889 enum H5O_COPY_WITHOUT_ATTR_FLAG = (0x0010u); /* Copy object without copying attributes */ 890 enum H5O_COPY_PRESERVE_NULL_FLAG = (0x0020u); /* Copy NULL messages (empty space) */ 891 enum H5O_COPY_MERGE_COMMITTED_DTYPE_FLAG = (0x0040u); /* Merge committed datatypes in dest file */ 892 enum H5O_COPY_ALL =(0x007Fu); /* All object copying flags (for internal checking) */ 893 894 /* Flags for shared message indexes. 895 * Pass these flags in using the mesg_type_flags parameter in 896 * H5P_set_shared_mesg_index. 897 * (Developers: These flags correspond to object header message type IDs, 898 * but we need to assign each kind of message to a different bit so that 899 * one index can hold multiple types.) 900 */ 901 enum H5O_SHMESG_NONE_FLAG = 0x0000; /* No shared messages */ 902 enum H5O_SHMESG_SDSPACE_FLAG = (cast(uint)1 << 0x0001); /* Simple Dataspace Message. */ 903 enum H5O_SHMESG_DTYPE_FLAG = (cast(uint)1 << 0x0003); /* Datatype Message. */ 904 enum H5O_SHMESG_FILL_FLAG = (cast(uint)1 << 0x0005); /* Fill Value Message. */ 905 enum H5O_SHMESG_PLINE_FLAG = (cast(uint)1 << 0x000b); /* Filter pipeline message. */ 906 enum H5O_SHMESG_ATTR_FLAG = (cast(uint)1 << 0x000c); /* Attribute Message. */ 907 enum H5O_SHMESG_ALL_FLAG = (H5O_SHMESG_SDSPACE_FLAG | H5O_SHMESG_DTYPE_FLAG | H5O_SHMESG_FILL_FLAG | H5O_SHMESG_PLINE_FLAG | H5O_SHMESG_ATTR_FLAG); 908 909 /* Object header status flag definitions */ 910 enum H5O_HDR_CHUNK0_SIZE = 0x03; /* 2-bit field indicating # of bytes to store the size of chunk 0's data */ 911 enum H5O_HDR_ATTR_CRT_ORDER_TRACKED = 0x04; /* Attribute creation order is tracked */ 912 enum H5O_HDR_ATTR_CRT_ORDER_INDEXED = 0x08; /* Attribute creation order has index */ 913 enum H5O_HDR_ATTR_STORE_PHASE_CHANGE = 0x10; /* Non-default attribute storage phase change values stored */ 914 enum H5O_HDR_STORE_TIMES = 0x20; /* Store access, modification, change & birth times for object */ 915 enum H5O_HDR_ALL_FLAGS = (H5O_HDR_CHUNK0_SIZE | H5O_HDR_ATTR_CRT_ORDER_TRACKED | H5O_HDR_ATTR_CRT_ORDER_INDEXED | H5O_HDR_ATTR_STORE_PHASE_CHANGE | H5O_HDR_STORE_TIMES); 916 917 /* Maximum shared message values. Number of indexes is 8 to allow room to add 918 * new types of messages. 919 */ 920 enum H5O_SHMESG_MAX_NINDEXES = 8; 921 enum H5O_SHMESG_MAX_LIST_SIZE = 5000; 922 923 /*******************/ 924 /* Public Typedefs */ 925 /*******************/ 926 927 /* Types of objects in file */ 928 enum H5OType { 929 Unknown = -1, /* Unknown object type */ 930 Group, /* Object is a group */ 931 Dataset, /* Object is a dataset */ 932 NamedDataType, /* Object is a named data type */ 933 TypeNTypes /* Number of different object types (must be last!) */ 934 } 935 936 /* Information struct for object header metadata (for H5Oget_info/H5Oget_info_by_name/H5Oget_info_by_idx) */ 937 align(1) 938 { 939 struct H5O_hdr_info_t { 940 uint _version; /* Version number of header format in file */ 941 uint nmesgs; /* Number of object header messages */ 942 uint nchunks; /* Number of object header chunks */ 943 uint flags; /* Object header status flags */ 944 struct space { 945 hsize_t total; /* Total space for storing object header in file */ 946 hsize_t meta; /* Space within header for object header metadata information */ 947 hsize_t mesg; /* Space within header for actual message information */ 948 hsize_t free; /* Free space within object header */ 949 } 950 struct mesg { 951 uint64_t present; /* Flags to indicate presence of message type in header */ 952 uint64_t _shared; /* Flags to indicate message type is shared in header */ 953 } 954 } 955 } 956 957 /* Information struct for object (for H5Oget_info/H5Oget_info_by_name/H5Oget_info_by_idx) */ 958 struct H5O_info_t { 959 ulong fileno; /* File number that object is located in */ 960 haddr_t addr; /* Object address in file */ 961 H5OType type; /* Basic object type (group, dataset, etc.) */ 962 uint rc; /* Reference count of object */ 963 time_t atime; /* Access time */ 964 time_t mtime; /* Modification time */ 965 time_t ctime; /* Change time */ 966 time_t btime; /* Birth time */ 967 hsize_t num_attrs; /* # of attributes attached to object */ 968 H5O_hdr_info_t hdr; /* Object header information */ 969 /* Extra metadata storage for obj & attributes */ 970 struct meta_size { 971 H5_ih_info_t obj; /* v1/v2 B-tree & local/fractal heap for groups, B-tree for chunked datasets */ 972 H5_ih_info_t attr; /* v2 B-tree & heap for attributes */ 973 } 974 } 975 } 976 977 extern(C) 978 { 979 /* Typedef for message creation indexes */ 980 alias H5O_msg_crt_idx_t = uint32_t; 981 982 /* Prototype for H5Ovisit/H5Ovisit_by_name() operator */ 983 alias H5O_iterate_t = herr_t function(hid_t obj, const char *name, const H5O_info_t *info, void *op_data); 984 } 985 enum H5O_mcdt_search_ret_t { 986 H5O_MCDT_SEARCH_ERROR = -1, /* Abort H5Ocopy */ 987 H5O_MCDT_SEARCH_CONT, /* Continue the global search of all committed datatypes in the destination file */ 988 H5O_MCDT_SEARCH_STOP /* Stop the search, but continue copying. The committed datatype will be copied but not merged. */ 989 }; 990 991 /* Callback to invoke when completing the search for a matching committed datatype from the committed dtype list */ 992 extern(C) 993 { 994 alias H5O_mcdt_search_cb_t = H5O_mcdt_search_ret_t function(void *op_data); 995 } 996 /********************/ 997 /* Public Variables */ 998 /********************/ 999 1000 version(Posix) 1001 { 1002 extern(C) 1003 { 1004 // Public Prototypes 1005 hid_t H5Oopen(hid_t loc_id, const char *name, hid_t lapl_id); 1006 hid_t H5Oopen_by_addr(hid_t loc_id, haddr_t addr); 1007 hid_t H5Oopen_by_idx(hid_t loc_id, const char *group_name, H5Index idx_type, H5IterOrder order, hsize_t n, hid_t lapl_id); 1008 htri_t H5Oexists_by_name(hid_t loc_id, const char *name, hid_t lapl_id); 1009 herr_t H5Oget_info(hid_t loc_id, H5O_info_t *oinfo); 1010 herr_t H5Oget_info_by_name(hid_t loc_id, const (char *)name, H5O_info_t *oinfo, hid_t lapl_id); 1011 herr_t H5Oget_info_by_idx(hid_t loc_id, const char *group_name, H5Index idx_type, H5IterOrder order, hsize_t n, H5O_info_t *oinfo, hid_t lapl_id); 1012 herr_t H5Olink(hid_t obj_id, hid_t new_loc_id, const char *new_name, hid_t lcpl_id, hid_t lapl_id); 1013 herr_t H5Oincr_refcount(hid_t object_id); 1014 herr_t H5Odecr_refcount(hid_t object_id); 1015 herr_t H5Ocopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id); 1016 herr_t H5Oset_comment(hid_t obj_id, const char *comment); 1017 herr_t H5Oset_comment_by_name(hid_t loc_id, const char *name, const char *comment, hid_t lapl_id); 1018 ssize_t H5Oget_comment(hid_t obj_id, char *comment, size_t bufsize); 1019 ssize_t H5Oget_comment_by_name(hid_t loc_id, const char *name, char *comment, size_t bufsize, hid_t lapl_id); 1020 herr_t H5Ovisit(hid_t obj_id, H5Index idx_type, H5IterOrder order, H5O_iterate_t op, void *op_data); 1021 herr_t H5Ovisit_by_name(hid_t loc_id, const char *obj_name, H5Index idx_type, H5IterOrder order, H5O_iterate_t op, void *op_data, hid_t lapl_id); 1022 herr_t H5Oclose(hid_t object_id); 1023 } 1024 } 1025 extern(C) 1026 { 1027 1028 /*****************/ 1029 /* Public Macros */ 1030 /*****************/ 1031 1032 /* 1033 * The library's property list classes 1034 */ 1035 alias H5P_ROOT = H5P_CLS_ROOT_g; 1036 alias H5P_OBJECT_CREATE = H5P_CLS_OBJECT_CREATE_g; 1037 alias H5P_FILE_CREATE = H5P_CLS_FILE_CREATE_g; 1038 alias H5P_FILE_ACCESS = H5P_CLS_FILE_ACCESS_g; 1039 alias H5P_DATASET_CREATE = H5P_CLS_DATASET_CREATE_g; 1040 alias H5P_DATASET_ACCESS = H5P_CLS_DATASET_ACCESS_g; 1041 alias H5P_DATASET_XFER = H5P_CLS_DATASET_XFER_g; 1042 alias H5P_FILE_MOUNT = H5P_CLS_FILE_MOUNT_g; 1043 alias H5P_GROUP_CREATE = H5P_CLS_GROUP_CREATE_g; 1044 alias H5P_GROUP_ACCESS = H5P_CLS_GROUP_ACCESS_g; 1045 alias H5P_DATATYPE_CREATE = H5P_CLS_DATATYPE_CREATE_g; 1046 alias H5P_DATATYPE_ACCESS = H5P_CLS_DATATYPE_ACCESS_g; 1047 alias H5P_STRING_CREATE = H5P_CLS_STRING_CREATE_g; 1048 alias H5P_ATTRIBUTE_CREATE = H5P_CLS_ATTRIBUTE_CREATE_g; 1049 alias H5P_OBJECT_COPY = H5P_CLS_OBJECT_COPY_g; 1050 alias H5P_LINK_CREATE = H5P_CLS_LINK_CREATE_g; 1051 alias H5P_LINK_ACCESS = H5P_CLS_LINK_ACCESS_g; 1052 1053 /* 1054 * The library's default property lists 1055 */ 1056 alias H5P_FILE_CREATE_DEFAULT = H5P_LST_FILE_CREATE_g; 1057 alias H5P_FILE_ACCESS_DEFAULT = H5P_LST_FILE_ACCESS_g; 1058 alias H5P_DATASET_CREATE_DEFAULT = H5P_LST_DATASET_CREATE_g; 1059 alias H5P_DATASET_ACCESS_DEFAULT = H5P_LST_DATASET_ACCESS_g; 1060 alias H5P_DATASET_XFER_DEFAULT = H5P_LST_DATASET_XFER_g; 1061 alias H5P_FILE_MOUNT_DEFAULT = H5P_LST_FILE_MOUNT_g; 1062 alias H5P_GROUP_CREATE_DEFAULT = H5P_LST_GROUP_CREATE_g; 1063 alias H5P_GROUP_ACCESS_DEFAULT = H5P_LST_GROUP_ACCESS_g; 1064 alias H5P_DATATYPE_CREATE_DEFAULT = H5P_LST_DATATYPE_CREATE_g; 1065 alias H5P_DATATYPE_ACCESS_DEFAULT = H5P_LST_DATATYPE_ACCESS_g; 1066 alias H5P_ATTRIBUTE_CREATE_DEFAULT = H5P_LST_ATTRIBUTE_CREATE_g; 1067 alias H5P_OBJECT_COPY_DEFAULT = H5P_LST_OBJECT_COPY_g; 1068 alias H5P_LINK_CREATE_DEFAULT = H5P_LST_LINK_CREATE_g; 1069 alias H5P_LINK_ACCESS_DEFAULT = H5P_LST_LINK_ACCESS_g; 1070 1071 /* Common creation order flags (for links in groups and attributes on objects) */ 1072 enum H5P_CRT_ORDER_TRACKED = 0x0001; 1073 enum H5P_CRT_ORDER_INDEXED = 0x0002; 1074 1075 /*******************/ 1076 /* Public Typedefs */ 1077 /*******************/ 1078 1079 /* Define property list class callback function pointer types */ 1080 alias H5P_cls_create_func_t = herr_t function(hid_t prop_id, void *create_data); 1081 alias H5P_cls_copy_func_t = herr_t function(hid_t new_prop_id, hid_t old_prop_id, void *copy_data); 1082 alias H5P_cls_close_func_t = herr_t function(hid_t prop_id, void *close_data); 1083 1084 /* Define property list callback function pointer types */ 1085 alias H5P_prp_cb1_t = herr_t function(const char *name, size_t size, void *value); 1086 alias H5P_prp_cb2_t = herr_t function(hid_t prop_id, const char *name, size_t size, void *value); 1087 alias H5P_prp_create_func_t = H5P_prp_cb1_t; 1088 alias H5P_prp_set_func_t = H5P_prp_cb2_t; 1089 alias H5P_prp_get_func_t = H5P_prp_cb2_t; 1090 alias H5P_prp_delete_func_t = H5P_prp_cb2_t; 1091 alias H5P_prp_copy_func_t = H5P_prp_cb1_t; 1092 alias H5P_prp_compare_func_t = int function(const void *value1, const void *value2, size_t size); 1093 alias H5P_prp_close_func_t = H5P_prp_cb1_t; 1094 1095 /* Define property list iteration function type */ 1096 alias H5P_iterate_t = herr_t function(hid_t id, const char *name, void *iter_data); 1097 } 1098 1099 /* Actual IO mode property */ 1100 enum H5D_mpio_actual_chunk_opt_mode_t { 1101 /* The default value, H5D_MPIO_NO_CHUNK_OPTIMIZATION, is used for all I/O 1102 * operations that do not use chunk optimizations, including non-collective 1103 * I/O and contiguous collective I/O. 1104 */ 1105 H5D_MPIO_NO_CHUNK_OPTIMIZATION = 0, 1106 H5D_MPIO_LINK_CHUNK, 1107 H5D_MPIO_MULTI_CHUNK 1108 } 1109 1110 enum H5D_mpio_actual_io_mode_t { 1111 /* The following four values are conveniently defined as a bit field so that 1112 * we can switch from the default to indpendent or collective and then to 1113 * mixed without having to check the original value. 1114 * 1115 * NO_COLLECTIVE means that either collective I/O wasn't requested or that 1116 * no I/O took place. 1117 * 1118 * CHUNK_INDEPENDENT means that collective I/O was requested, but the 1119 * chunk optimization scheme chose independent I/O for each chunk. 1120 */ 1121 H5D_MPIO_NO_COLLECTIVE = 0x0, 1122 H5D_MPIO_CHUNK_INDEPENDENT = 0x1, 1123 H5D_MPIO_CHUNK_COLLECTIVE = 0x2, 1124 H5D_MPIO_CHUNK_MIXED = 0x1 | 0x2, 1125 1126 /* The contiguous case is separate from the bit field. */ 1127 H5D_MPIO_CONTIGUOUS_COLLECTIVE = 0x4 1128 } 1129 1130 /* Broken collective IO property */ 1131 enum H5D_mpio_no_collective_cause_t { 1132 H5D_MPIO_COLLECTIVE = 0x00, 1133 H5D_MPIO_SET_INDEPENDENT = 0x01, 1134 H5D_MPIO_DATATYPE_CONVERSION = 0x02, 1135 H5D_MPIO_DATA_TRANSFORMS = 0x04, 1136 H5D_MPIO_MPI_OPT_TYPES_ENV_VAR_DISABLED = 0x08, 1137 H5D_MPIO_NOT_SIMPLE_OR_SCALAR_DATASPACES = 0x10, 1138 H5D_MPIO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET = 0x20, 1139 H5D_MPIO_FILTERS = 0x40 1140 } 1141 1142 /********************/ 1143 /* Public Variables */ 1144 /********************/ 1145 1146 /* Property list class IDs */ 1147 /* (Internal to library, do not use! Use macros above) */ 1148 extern(C) 1149 { 1150 extern __gshared hid_t H5P_CLS_ROOT_g; 1151 extern __gshared hid_t H5P_CLS_OBJECT_CREATE_g; 1152 extern __gshared hid_t H5P_CLS_FILE_CREATE_g; 1153 extern __gshared hid_t H5P_CLS_FILE_ACCESS_g; 1154 extern __gshared hid_t H5P_CLS_DATASET_CREATE_g; 1155 extern __gshared hid_t H5P_CLS_DATASET_ACCESS_g; 1156 extern __gshared hid_t H5P_CLS_DATASET_XFER_g; 1157 extern __gshared hid_t H5P_CLS_FILE_MOUNT_g; 1158 extern __gshared hid_t H5P_CLS_GROUP_CREATE_g; 1159 extern __gshared hid_t H5P_CLS_GROUP_ACCESS_g; 1160 extern __gshared hid_t H5P_CLS_DATATYPE_CREATE_g; 1161 extern __gshared hid_t H5P_CLS_DATATYPE_ACCESS_g; 1162 extern __gshared hid_t H5P_CLS_STRING_CREATE_g; 1163 extern __gshared hid_t H5P_CLS_ATTRIBUTE_CREATE_g; 1164 extern __gshared hid_t H5P_CLS_OBJECT_COPY_g; 1165 extern __gshared hid_t H5P_CLS_LINK_CREATE_g; 1166 extern __gshared hid_t H5P_CLS_LINK_ACCESS_g; 1167 1168 /* Default roperty list IDs */ 1169 /* (Internal to library, do not use! Use macros above) */ 1170 extern __gshared hid_t H5P_LST_FILE_CREATE_g; 1171 extern __gshared hid_t H5P_LST_FILE_ACCESS_g; 1172 extern __gshared hid_t H5P_LST_DATASET_CREATE_g; 1173 extern __gshared hid_t H5P_LST_DATASET_ACCESS_g; 1174 extern __gshared hid_t H5P_LST_DATASET_XFER_g; 1175 extern __gshared hid_t H5P_LST_FILE_MOUNT_g; 1176 extern __gshared hid_t H5P_LST_GROUP_CREATE_g; 1177 extern __gshared hid_t H5P_LST_GROUP_ACCESS_g; 1178 extern __gshared hid_t H5P_LST_DATATYPE_CREATE_g; 1179 extern __gshared hid_t H5P_LST_DATATYPE_ACCESS_g; 1180 extern __gshared hid_t H5P_LST_ATTRIBUTE_CREATE_g; 1181 extern __gshared hid_t H5P_LST_OBJECT_COPY_g; 1182 extern __gshared hid_t H5P_LST_LINK_CREATE_g; 1183 extern __gshared hid_t H5P_LST_LINK_ACCESS_g; 1184 } 1185 /*********************/ 1186 /* Public Prototypes */ 1187 /*********************/ 1188 1189 version(Posix) { 1190 extern(C) 1191 { 1192 /* Generic property list routines */ 1193 hid_t H5Pcreate_class(hid_t parent, const char *name, H5P_cls_create_func_t cls_create, void *create_data, 1194 H5P_cls_copy_func_t cls_copy, void *copy_data, H5P_cls_close_func_t cls_close, void *close_data); 1195 char *H5Pget_class_name(hid_t pclass_id); 1196 hid_t H5Pcreate(hid_t cls_id); 1197 herr_t H5Pregister2(hid_t cls_id, const char *name, size_t size, void *def_value, H5P_prp_create_func_t prp_create, 1198 H5P_prp_set_func_t prp_set, H5P_prp_get_func_t prp_get, H5P_prp_delete_func_t prp_del, H5P_prp_copy_func_t prp_copy, 1199 H5P_prp_compare_func_t prp_cmp, H5P_prp_close_func_t prp_close); 1200 herr_t H5Pinsert2(hid_t plist_id, const char *name, size_t size, 1201 void *value, H5P_prp_set_func_t prp_set, H5P_prp_get_func_t prp_get, 1202 H5P_prp_delete_func_t prp_delete, H5P_prp_copy_func_t prp_copy, 1203 H5P_prp_compare_func_t prp_cmp, H5P_prp_close_func_t prp_close); 1204 herr_t H5Pset(hid_t plist_id, const char *name, void *value); 1205 htri_t H5Pexist(hid_t plist_id, const char *name); 1206 herr_t H5Pget_size(hid_t id, const char *name, size_t *size); 1207 herr_t H5Pget_nprops(hid_t id, size_t *nprops); 1208 hid_t H5Pget_class(hid_t plist_id); 1209 hid_t H5Pget_class_parent(hid_t pclass_id); 1210 herr_t H5Pget(hid_t plist_id, const char *name, void * value); 1211 htri_t H5Pequal(hid_t id1, hid_t id2); 1212 htri_t H5Pisa_class(hid_t plist_id, hid_t pclass_id); 1213 int H5Piterate(hid_t id, int *idx, H5P_iterate_t iter_func, 1214 void *iter_data); 1215 herr_t H5Pcopy_prop(hid_t dst_id, hid_t src_id, const char *name); 1216 herr_t H5Premove(hid_t plist_id, const char *name); 1217 herr_t H5Punregister(hid_t pclass_id, const char *name); 1218 herr_t H5Pclose_class(hid_t plist_id); 1219 herr_t H5Pclose(hid_t plist_id); 1220 hid_t H5Pcopy(hid_t plist_id); 1221 1222 /* Object creation property list (OCPL) routines */ 1223 herr_t H5Pset_attr_phase_change(hid_t plist_id, uint max_compact, uint min_dense); 1224 herr_t H5Pget_attr_phase_change(hid_t plist_id, uint *max_compact, uint *min_dense); 1225 herr_t H5Pset_attr_creation_order(hid_t plist_id, uint crt_order_flags); 1226 herr_t H5Pget_attr_creation_order(hid_t plist_id, uint *crt_order_flags); 1227 herr_t H5Pset_obj_track_times(hid_t plist_id, hbool_t track_times); 1228 herr_t H5Pget_obj_track_times(hid_t plist_id, hbool_t *track_times); 1229 herr_t H5Pmodify_filter(hid_t plist_id, H5ZFilter filter, 1230 int flags, size_t cd_nelmts, 1231 const int* cd_values); 1232 herr_t H5Pset_filter(hid_t plist_id, H5ZFilter filter, int flags, size_t cd_nelmts, const int* c_values); 1233 int H5Pget_nfilters(hid_t plist_id); 1234 H5ZFilter H5Pget_filter2(hid_t plist_id, uint filter, 1235 int *flags/*out*/, 1236 size_t *cd_nelmts/*out*/, 1237 uint* cd_values/*out*/, 1238 size_t namelen, char* name, 1239 uint *filter_config /*out*/); 1240 herr_t H5Pget_filter_by_id2(hid_t plist_id, H5ZFilter id, 1241 uint *flags/*out*/, size_t *cd_nelmts/*out*/, 1242 int* cd_values/*out*/, size_t namelen, char* name/*out*/, 1243 int *filter_config/*out*/); 1244 htri_t H5Pall_filters_avail(hid_t plist_id); 1245 herr_t H5Premove_filter(hid_t plist_id, H5ZFilter filter); 1246 herr_t H5Pset_deflate(hid_t plist_id, int aggression); 1247 herr_t H5Pset_fletcher32(hid_t plist_id); 1248 1249 /* File creation property list (FCPL) routines */ 1250 herr_t H5Pget_version(hid_t plist_id, uint *boot/*out*/, 1251 uint *freelist/*out*/, uint *stab/*out*/, 1252 uint *shhdr/*out*/); 1253 herr_t H5Pset_userblock(hid_t plist_id, hsize_t size); 1254 herr_t H5Pget_userblock(hid_t plist_id, hsize_t *size); 1255 herr_t H5Pset_sizes(hid_t plist_id, size_t sizeof_addr, 1256 size_t sizeof_size); 1257 herr_t H5Pget_sizes(hid_t plist_id, size_t *sizeof_addr/*out*/, 1258 size_t *sizeof_size/*out*/); 1259 herr_t H5Pset_sym_k(hid_t plist_id, uint ik, uint lk); 1260 herr_t H5Pget_sym_k(hid_t plist_id, uint *ik/*out*/, uint *lk/*out*/); 1261 herr_t H5Pset_istore_k(hid_t plist_id, uint ik); 1262 herr_t H5Pget_istore_k(hid_t plist_id, uint *ik/*out*/); 1263 herr_t H5Pset_shared_mesg_nindexes(hid_t plist_id, uint nindexes); 1264 herr_t H5Pget_shared_mesg_nindexes(hid_t plist_id, uint *nindexes); 1265 herr_t H5Pset_shared_mesg_index(hid_t plist_id, uint index_num, uint mesg_type_flags, uint min_mesg_size); 1266 herr_t H5Pget_shared_mesg_index(hid_t plist_id, uint index_num, uint *mesg_type_flags, uint *min_mesg_size); 1267 herr_t H5Pset_shared_mesg_phase_change(hid_t plist_id, uint max_list, uint min_btree); 1268 herr_t H5Pget_shared_mesg_phase_change(hid_t plist_id, uint *max_list, uint *min_btree); 1269 1270 /* File access property list (FAPL) routines */ 1271 herr_t H5Pset_alignment(hid_t fapl_id, hsize_t threshold, 1272 hsize_t alignment); 1273 herr_t H5Pget_alignment(hid_t fapl_id, hsize_t *threshold/*out*/, 1274 hsize_t *alignment/*out*/); 1275 herr_t H5Pset_driver(hid_t plist_id, hid_t driver_id, 1276 const void *driver_info); 1277 hid_t H5Pget_driver(hid_t plist_id); 1278 void *H5Pget_driver_info(hid_t plist_id); 1279 herr_t H5Pset_family_offset(hid_t fapl_id, hsize_t offset); 1280 herr_t H5Pget_family_offset(hid_t fapl_id, hsize_t *offset); 1281 herr_t H5Pset_cache(hid_t plist_id, int mdc_nelmts, 1282 size_t rdcc_nslots, size_t rdcc_nbytes, 1283 double rdcc_w0); 1284 herr_t H5Pget_cache(hid_t plist_id, 1285 int *mdc_nelmts, /* out */ 1286 size_t *rdcc_nslots/*out*/, 1287 size_t *rdcc_nbytes/*out*/, double *rdcc_w0); 1288 herr_t H5Pset_gc_references(hid_t fapl_id, uint gc_ref); 1289 herr_t H5Pget_gc_references(hid_t fapl_id, uint *gc_ref/*out*/); 1290 herr_t H5Pset_fclose_degree(hid_t fapl_id, H5F_close_degree_t degree); 1291 herr_t H5Pget_fclose_degree(hid_t fapl_id, H5F_close_degree_t *degree); 1292 herr_t H5Pset_meta_block_size(hid_t fapl_id, hsize_t size); 1293 herr_t H5Pget_meta_block_size(hid_t fapl_id, hsize_t *size/*out*/); 1294 herr_t H5Pset_sieve_buf_size(hid_t fapl_id, size_t size); 1295 herr_t H5Pget_sieve_buf_size(hid_t fapl_id, size_t *size/*out*/); 1296 herr_t H5Pset_small_data_block_size(hid_t fapl_id, hsize_t size); 1297 herr_t H5Pget_small_data_block_size(hid_t fapl_id, hsize_t *size/*out*/); 1298 herr_t H5Pset_libver_bounds(hid_t plist_id, H5F_libver_t low, 1299 H5F_libver_t high); 1300 herr_t H5Pget_libver_bounds(hid_t plist_id, H5F_libver_t *low, 1301 H5F_libver_t *high); 1302 herr_t H5Pset_elink_file_cache_size(hid_t plist_id, uint efc_size); 1303 herr_t H5Pget_elink_file_cache_size(hid_t plist_id, uint *efc_size); 1304 herr_t H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len); 1305 herr_t H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr); 1306 version(h5parallel) herr_t H5Pset_core_write_tracking(hid_t fapl_id, hbool_t is_enabled, size_t page_size); 1307 version(h5parallel) herr_t H5Pget_core_write_tracking(hid_t fapl_id, hbool_t *is_enabled, size_t *page_size); 1308 herr_t H5Pset_layout(hid_t plist_id, H5DLayout layout); 1309 H5DLayout H5Pget_layout(hid_t plist_id); 1310 herr_t H5Pset_chunk(hid_t plist_id, int ndims, const hsize_t *dim/*ndims*/); 1311 int H5Pget_chunk(hid_t plist_id, int max_ndims, hsize_t *dim/*out*/); 1312 herr_t H5Pset_external(hid_t plist_id, const char *name, off_t offset, 1313 hsize_t size); 1314 int H5Pget_external_count(hid_t plist_id); 1315 herr_t H5Pget_external(hid_t plist_id, uint idx, size_t name_size, 1316 char *name/*out*/, off_t *offset/*out*/, 1317 hsize_t *size/*out*/); 1318 herr_t H5Pset_szip(hid_t plist_id, uint options_mask, uint pixels_per_block); 1319 herr_t H5Pset_shuffle(hid_t plist_id); 1320 herr_t H5Pset_nbit(hid_t plist_id); 1321 herr_t H5Pset_scaleoffset(hid_t plist_id, H5Z_SO_scale_type_t scale_type, int scale_factor); 1322 herr_t H5Pset_fill_value(hid_t plist_id, hid_t type_id, const void *value); 1323 herr_t H5Pget_fill_value(hid_t plist_id, hid_t type_id, void *value/*out*/); 1324 herr_t H5Pfill_value_defined(hid_t plist, H5D_fill_value_t *status); 1325 herr_t H5Pset_alloc_time(hid_t plist_id, H5DAllocTime alloc_time); 1326 herr_t H5Pget_alloc_time(hid_t plist_id, H5DAllocTime *alloc_time/*out*/); 1327 herr_t H5Pset_fill_time(hid_t plist_id, H5D_fill_time_t fill_time); 1328 herr_t H5Pget_fill_time(hid_t plist_id, H5D_fill_time_t *fill_time/*out*/); 1329 1330 /* Dataset access property list (DAPL) routines */ 1331 herr_t H5Pset_chunk_cache(hid_t dapl_id, size_t rdcc_nslots, 1332 size_t rdcc_nbytes, double rdcc_w0); 1333 herr_t H5Pget_chunk_cache(hid_t dapl_id, 1334 size_t *rdcc_nslots/*out*/, 1335 size_t *rdcc_nbytes/*out*/, 1336 double *rdcc_w0/*out*/); 1337 1338 /* Dataset xfer property list (DXPL) routines */ 1339 herr_t H5Pset_data_transform(hid_t plist_id, const char* expression); 1340 ssize_t H5Pget_data_transform(hid_t plist_id, char* expression /*out*/, size_t size); 1341 herr_t H5Pset_buffer(hid_t plist_id, size_t size, void *tconv, 1342 void *bkg); 1343 size_t H5Pget_buffer(hid_t plist_id, void **tconv/*out*/, 1344 void **bkg/*out*/); 1345 herr_t H5Pset_preserve(hid_t plist_id, hbool_t status); 1346 int H5Pget_preserve(hid_t plist_id); 1347 herr_t H5Pset_edc_check(hid_t plist_id, H5Z_EDC_t check); 1348 H5Z_EDC_t H5Pget_edc_check(hid_t plist_id); 1349 herr_t H5Pset_filter_callback(hid_t plist_id, H5Z_filter_func_t func, 1350 void* op_data); 1351 herr_t H5Pset_btree_ratios(hid_t plist_id, double left, double middle, 1352 double right); 1353 herr_t H5Pget_btree_ratios(hid_t plist_id, double *left/*out*/, 1354 double *middle/*out*/, 1355 double *right/*out*/); 1356 herr_t H5Pset_hyper_vector_size(hid_t fapl_id, size_t size); 1357 herr_t H5Pget_hyper_vector_size(hid_t fapl_id, size_t *size/*out*/); 1358 herr_t H5Pset_type_conv_cb(hid_t dxpl_id, H5T_conv_except_func_t op, void* operate_data); 1359 herr_t H5Pget_type_conv_cb(hid_t dxpl_id, H5T_conv_except_func_t *op, void** operate_data); 1360 version(h5parallel) 1361 { 1362 herr_t H5Pget_mpio_actual_chunk_opt_mode(hid_t plist_id, H5D_mpio_actual_chunk_opt_mode_t *actual_chunk_opt_mode); 1363 herr_t H5Pget_mpio_actual_io_mode(hid_t plist_id, H5D_mpio_actual_io_mode_t *actual_io_mode); 1364 herr_t H5Pget_mpio_no_collective_cause(hid_t plist_id, uint32_t *local_no_collective_cause, uint32_t *global_no_collective_cause); 1365 } 1366 1367 /* Link creation property list (LCPL) routines */ 1368 herr_t H5Pset_create_intermediate_group(hid_t plist_id, uint crt_intmd); 1369 herr_t H5Pget_create_intermediate_group(hid_t plist_id, uint *crt_intmd /*out*/); 1370 1371 /* Group creation property list (GCPL) routines */ 1372 herr_t H5Pset_local_heap_size_hint(hid_t plist_id, size_t size_hint); 1373 herr_t H5Pget_local_heap_size_hint(hid_t plist_id, size_t *size_hint /*out*/); 1374 herr_t H5Pset_link_phase_change(hid_t plist_id, uint max_compact, uint min_dense); 1375 herr_t H5Pget_link_phase_change(hid_t plist_id, uint *max_compact /*out*/, uint *min_dense /*out*/); 1376 herr_t H5Pset_est_link_info(hid_t plist_id, uint est_num_entries, uint est_name_len); 1377 herr_t H5Pget_est_link_info(hid_t plist_id, uint *est_num_entries /* out */, uint *est_name_len /* out */); 1378 herr_t H5Pset_link_creation_order(hid_t plist_id, uint crt_order_flags); 1379 herr_t H5Pget_link_creation_order(hid_t plist_id, uint *crt_order_flags /* out */); 1380 1381 /* String creation property list (STRCPL) routines */ 1382 herr_t H5Pset_char_encoding(hid_t plist_id, H5TCset encoding); 1383 herr_t H5Pget_char_encoding(hid_t plist_id, H5TCset *encoding /*out*/); 1384 1385 /* Link access property list (LAPL) routines */ 1386 herr_t H5Pset_nlinks(hid_t plist_id, size_t nlinks); 1387 herr_t H5Pget_nlinks(hid_t plist_id, size_t *nlinks); 1388 herr_t H5Pset_elink_prefix(hid_t plist_id, const char *prefix); 1389 ssize_t H5Pget_elink_prefix(hid_t plist_id, char *prefix, size_t size); 1390 hid_t H5Pget_elink_fapl(hid_t lapl_id); 1391 herr_t H5Pset_elink_fapl(hid_t lapl_id, hid_t fapl_id); 1392 herr_t H5Pset_elink_acc_flags(hid_t lapl_id, uint flags); 1393 herr_t H5Pget_elink_acc_flags(hid_t lapl_id, uint *flags); 1394 /++ 1395 herr_t H5Pset_elink_cb(hid_t lapl_id, H5L_elink_traverse_t func, void *op_data); 1396 herr_t H5Pget_elink_cb(hid_t lapl_id, H5L_elink_traverse_t *func, void **op_data); 1397 +/ 1398 1399 /* Object copy property list (OCPYPL) routines */ 1400 herr_t H5Pset_copy_object(hid_t plist_id, uint crt_intmd); 1401 herr_t H5Pget_copy_object(hid_t plist_id, uint *crt_intmd /*out*/); 1402 herr_t H5Padd_merge_committed_dtype_path(hid_t plist_id, const char *path); 1403 herr_t H5Pfree_merge_committed_dtype_paths(hid_t plist_id); 1404 /++ 1405 herr_t H5Pset_mcdt_search_cb(hid_t plist_id, H5O_mcdt_search_cb_t func, void *op_data); 1406 herr_t H5Pget_mcdt_search_cb(hid_t plist_id, H5O_mcdt_search_cb_t *func, void **op_data); 1407 +/ 1408 1409 } 1410 } 1411 1412 enum H5RType 1413 { 1414 BadType=-1, /*invalid Reference Type */ 1415 ObjectRef, /*Object reference */ 1416 DatasetRegion, /*Dataset Region Reference */ 1417 MaxType /*highest type (Invalid as true type) */ 1418 } 1419 1420 /* Note! Be careful with the sizes of the references because they should really 1421 * depend on the run-time values in the file. Unfortunately, the arrays need 1422 * to be defined at compile-time, so we have to go with the worst case sizes for 1423 * them. -QAK 1424 */ 1425 enum H5R_OBJ_REF_BUF_SIZE =haddr_t.sizeof; 1426 /* Object reference structure for user's code */ 1427 //alias hobj_ref_t haddr_t ; /* Needs to be large enough to store largest haddr_t in a worst case machine (ie. 8 bytes currently) */ 1428 1429 enum H5R_DSET_REG_REF_BUF_SIZE =haddr_t.sizeof+4; 1430 /* 4 is used instead of sizeof(int) to permit portability between 1431 the Crays and other machines (the heap ID is always encoded as an int32 anyway) 1432 */ 1433 /* Dataset Region reference structure for user's code */ 1434 alias hdset_reg_ref_t = ubyte[H5R_DSET_REG_REF_BUF_SIZE];/* Buffer to store heap ID and index */ 1435 /* Needs to be large enough to store largest haddr_t in a worst case machine (ie. 8 bytes currently) plus an int */ 1436 1437 extern(C) 1438 { 1439 herr_t H5Rcreate(void *_ref, hid_t loc_id, const char *name, H5RType reftype, hid_t space_id); 1440 hid_t H5Rdereference(hid_t dataset, H5RType ref_type, const void *_ref); 1441 hid_t H5Rget_region(hid_t dataset, H5RType ref_type, const void *_ref); 1442 herr_t H5Rget_obj_type2(hid_t id, H5RType ref_type, const void *_ref, H5OType *obj_type); 1443 ssize_t H5Rget_name(hid_t loc_id, H5RType ref_type, const void *_ref, char *name/*out*/, size_t size); 1444 } 1445 1446 1447 /* Define atomic datatypes */ 1448 enum H5S_ALL = 0; 1449 enum H5S_UNLIMITED = (cast(hsize_t)cast(hssize_t)(-1)); 1450 1451 /* Define user-level maximum number of dimensions */ 1452 enum H5S_MAX_RANK = 32; 1453 1454 /* Different types of dataspaces */ 1455 enum H5SClass { 1456 None = -1, /*error */ 1457 Scalar = 0, /*scalar variable */ 1458 Simple = 1, /*simple data space */ 1459 Null = 2 /*null data space */ 1460 } 1461 1462 /* Different ways of combining selections */ 1463 enum H5SSeloper { 1464 Noop = -1, /* error */ 1465 Set = 0, /* Select "set" operation */ 1466 Or, 1467 And, 1468 Xor, 1469 NotB, 1470 NotA, 1471 Append, 1472 Prepend, 1473 Invalid, 1474 } 1475 1476 enum { 1477 H5S_SELECT_NOOP = -1, /* error */ 1478 H5S_SELECT_SET = 0, /* Select "set" operation */ 1479 H5S_SELECT_OR, /* Binary "or" operation for hyperslabs 1480 * (add new selection to existing selection) 1481 * Original region: AAAAAAAAAA 1482 * New region: BBBBBBBBBB 1483 * A or B: CCCCCCCCCCCCCCCC 1484 */ 1485 H5S_SELECT_AND, /* Binary "and" operation for hyperslabs 1486 * (only leave overlapped regions in selection) 1487 * Original region: AAAAAAAAAA 1488 * New region: BBBBBBBBBB 1489 * A and B: CCCC 1490 */ 1491 H5S_SELECT_XOR, /* Binary "xor" operation for hyperslabs 1492 * (only leave non-overlapped regions in selection) 1493 * Original region: AAAAAAAAAA 1494 * New region: BBBBBBBBBB 1495 * A xor B: CCCCCC CCCCCC 1496 */ 1497 H5S_SELECT_NOTB, /* Binary "not" operation for hyperslabs 1498 * (only leave non-overlapped regions in original selection) 1499 * Original region: AAAAAAAAAA 1500 * New region: BBBBBBBBBB 1501 * A not B: CCCCCC 1502 */ 1503 H5S_SELECT_NOTA, /* Binary "not" operation for hyperslabs 1504 * (only leave non-overlapped regions in new selection) 1505 * Original region: AAAAAAAAAA 1506 * New region: BBBBBBBBBB 1507 * B not A: CCCCCC 1508 */ 1509 H5S_SELECT_APPEND, /* Append elements to end of point selection */ 1510 H5S_SELECT_PREPEND, /* Prepend elements to beginning of point selection */ 1511 H5S_SELECT_INVALID /* Invalid upper bound on selection operations */ 1512 } 1513 1514 /* Enumerated type for the type of selection */ 1515 enum H5S_sel_type { 1516 H5S_SEL_ERROR = -1, /* Error */ 1517 H5S_SEL_NONE = 0, /* Nothing selected */ 1518 H5S_SEL_POINTS = 1, /* Sequence of points selected */ 1519 H5S_SEL_HYPERSLABS = 2, /* "New-style" hyperslab selection defined */ 1520 H5S_SEL_ALL = 3, /* Entire extent selected */ 1521 H5S_SEL_N /*THIS MUST BE LAST */ 1522 } 1523 1524 1525 version(Posix) { 1526 extern(C) 1527 { 1528 /* Functions in H5S.c */ 1529 hid_t H5Screate(H5SClass type); 1530 hid_t H5Screate_simple(int rank, const hsize_t *dims, 1531 const hsize_t *maxdims); 1532 herr_t H5Sset_extent_simple(hid_t space_id, int rank, 1533 const hsize_t *dims, 1534 const hsize_t *max); 1535 hid_t H5Scopy(hid_t space_id); 1536 herr_t H5Sclose(hid_t space_id); 1537 herr_t H5Sencode(hid_t obj_id, void *buf, size_t *nalloc); 1538 hid_t H5Sdecode(const void *buf); 1539 hssize_t H5Sget_simple_extent_npoints(hid_t space_id); 1540 int H5Sget_simple_extent_ndims(hid_t space_id); 1541 int H5Sget_simple_extent_dims(hid_t space_id, hsize_t *dims, 1542 hsize_t *maxdims); 1543 htri_t H5Sis_simple(hid_t space_id); 1544 hssize_t H5Sget_select_npoints(hid_t spaceid); 1545 herr_t H5Sselect_hyperslab(hid_t space_id, H5SSeloper op, 1546 const hsize_t *start, 1547 const hsize_t *_stride, 1548 const hsize_t *count, 1549 const hsize_t *_block); 1550 hid_t H5Scombine_hyperslab(hid_t space_id, H5SSeloper op, 1551 const hsize_t *start, 1552 const hsize_t *_stride, 1553 const hsize_t *count, 1554 const hsize_t *_block); 1555 herr_t H5Sselect_select(hid_t space1_id, H5SSeloper op, 1556 hid_t space2_id); 1557 hid_t H5Scombine_select(hid_t space1_id, H5SSeloper op, 1558 hid_t space2_id); 1559 herr_t H5Sselect_elements(hid_t space_id, H5SSeloper op, 1560 size_t num_elem, const hsize_t *coord); 1561 H5SClass H5Sget_simple_extent_type(hid_t space_id); 1562 herr_t H5Sset_extent_none(hid_t space_id); 1563 herr_t H5Sextent_copy(hid_t dst_id,hid_t src_id); 1564 htri_t H5Sextent_equal(hid_t sid1, hid_t sid2); 1565 herr_t H5Sselect_all(hid_t spaceid); 1566 herr_t H5Sselect_none(hid_t spaceid); 1567 herr_t H5Soffset_simple(hid_t space_id, const hssize_t *offset); 1568 htri_t H5Sselect_valid(hid_t spaceid); 1569 hssize_t H5Sget_select_hyper_nblocks(hid_t spaceid); 1570 hssize_t H5Sget_select_elem_npoints(hid_t spaceid); 1571 herr_t H5Sget_select_hyper_blocklist(hid_t spaceid, hsize_t startblock, 1572 hsize_t numblocks, hsize_t *buf); 1573 herr_t H5Sget_select_elem_pointlist(hid_t spaceid, hsize_t startpoint, 1574 hsize_t numpoints, hsize_t *buf); 1575 herr_t H5Sget_select_bounds(hid_t spaceid, hsize_t *start, 1576 hsize_t *end); 1577 H5S_sel_type H5Sget_select_type(hid_t spaceid); 1578 } 1579 } 1580 1581 /* These are the various classes of datatypes */ 1582 /* If this goes over 16 types (0-15), the file format will need to change) */ 1583 enum H5TClass { 1584 None = -1, /*error */ 1585 Integer = 0, /*integer types */ 1586 Float = 1, /*floating-point types */ 1587 Time = 2, /*date and time types */ 1588 String = 3, /*character string types */ 1589 Bitfield = 4, /*bit field types */ 1590 Opaque = 5, /*opaque types */ 1591 Compound = 6, /*compound types */ 1592 Reference = 7, /*reference types */ 1593 Enum = 8, /*enumeration types */ 1594 Vlen = 9, /*Variable-Length types */ 1595 Array = 10, /*Array types */ 1596 Nclasses /*this must be last */ 1597 } 1598 1599 /* Byte orders */ 1600 enum H5TByteOrder { 1601 Error = -1, /*error */ 1602 LE = 0, /*little endian */ 1603 BE = 1, /*bit endian */ 1604 Vax = 2, /*VAX mixed endian */ 1605 Mixed = 3, /*Compound type with mixed member orders */ 1606 None = 4 /*no particular order (strings, bits,..) */ 1607 /*H5T_ORDER_NONE must be last */ 1608 } 1609 1610 /* Types of integer sign schemes */ 1611 enum H5T_sign_t { 1612 H5T_SGN_ERROR = -1, /*error */ 1613 H5T_SGN_NONE = 0, /*this is an unsigned type */ 1614 H5T_SGN_2 = 1, /*two's complement */ 1615 1616 H5T_NSGN = 2 /*this must be last! */ 1617 } 1618 1619 /* Floating-point normalization schemes */ 1620 enum H5T_norm_t { 1621 H5T_NORM_ERROR = -1, /*error */ 1622 H5T_NORM_IMPLIED = 0, /*msb of mantissa isn't stored, always 1 */ 1623 H5T_NORM_MSBSET = 1, /*msb of mantissa is always 1 */ 1624 H5T_NORM_NONE = 2 /*not normalized */ 1625 /*H5T_NORM_NONE must be last */ 1626 } 1627 1628 /* 1629 * Character set to use for text strings. Do not change these values since 1630 * they appear in HDF5 files! 1631 */ 1632 enum H5TCset { 1633 Error = -1, /*error */ 1634 ASCII = 0, /*US ASCII */ 1635 UTF8 = 1, /*UTF-8 Unicode encoding */ 1636 Reserved2 = 2, /*reserved for later use */ 1637 Reserved3 = 3, /*reserved for later use */ 1638 Reserved4 = 4, /*reserved for later use */ 1639 Reserved5 = 5, /*reserved for later use */ 1640 Reserved6 = 6, /*reserved for later use */ 1641 Reserved7 = 7, /*reserved for later use */ 1642 Reserved8 = 8, /*reserved for later use */ 1643 Reserved9 = 9, /*reserved for later use */ 1644 Reserved10 = 10, /*reserved for later use */ 1645 Reserved11 = 11, /*reserved for later use */ 1646 Reserved12 = 12, /*reserved for later use */ 1647 Reserved13 = 13, /*reserved for later use */ 1648 Reserved14 = 14, /*reserved for later use */ 1649 Reserved15 = 15 /*reserved for later use */ 1650 } 1651 1652 enum H5T_NCSET = H5TCset.Reserved2 ; /*Number of character sets actually defined */ 1653 1654 /* 1655 * Type of padding to use in character strings. Do not change these values 1656 * since they appear in HDF5 files! 1657 */ 1658 enum H5TString { 1659 Error = -1, /*error */ 1660 Nullterm = 0, /*null terminate like in C */ 1661 Nullpas = 1, /*pad with nulls */ 1662 Spacepad = 2, /*pad with spaces like in Fortran */ 1663 Reserved3 = 3, /*reserved for later use */ 1664 Reserved4 = 4, /*reserved for later use */ 1665 Reserved5 = 5, /*reserved for later use */ 1666 Reserved6 = 6, /*reserved for later use */ 1667 Reserved7 = 7, /*reserved for later use */ 1668 Reserved8 = 8, /*reserved for later use */ 1669 Reserved9 = 9, /*reserved for later use */ 1670 Reserved10 = 10, /*reserved for later use */ 1671 Reserved11 = 11, /*reserved for later use */ 1672 Reserved12 = 12, /*reserved for later use */ 1673 Reserved13 = 13, /*reserved for later use */ 1674 Reserved14 = 14, /*reserved for later use */ 1675 Reserved15 = 15 /*reserved for later use */ 1676 } 1677 1678 enum H5T_NSTR = H5TString.Reserved3; /*num H5TString types actually defined */ 1679 1680 /* Type of padding to use in other atomic types */ 1681 enum H5T_pad_t { 1682 H5T_PAD_ERROR = -1, /*error */ 1683 H5T_PAD_ZERO = 0, /*always set to zero */ 1684 H5T_PAD_ONE = 1, /*always set to one */ 1685 H5T_PAD_BACKGROUND = 2, /*set to background value */ 1686 1687 H5T_NPAD = 3 /*THIS MUST BE LAST */ 1688 } 1689 1690 /* Commands sent to conversion functions */ 1691 enum H5T_cmd_t { 1692 H5T_CONV_INIT = 0, /*query and/or initialize private data */ 1693 H5T_CONV_CONV = 1, /*convert data from source to dest datatype */ 1694 H5T_CONV_FREE = 2 /*function is being removed from path */ 1695 } 1696 1697 /* How is the `bkg' buffer used by the conversion function? */ 1698 enum H5T_bkg_t { 1699 H5T_BKG_NO = 0, /*background buffer is not needed, send NULL */ 1700 H5T_BKG_TEMP = 1, /*bkg buffer used as temp storage only */ 1701 H5T_BKG_YES = 2 /*init bkg buf with data before conversion */ 1702 } 1703 1704 /* Type conversion client data */ 1705 struct H5T_cdata_t { 1706 H5T_cmd_t command;/*what should the conversion function do? */ 1707 H5T_bkg_t need_bkg;/*is the background buffer needed? */ 1708 hbool_t recalc; /*recalculate private data */ 1709 void *priv; /*private data */ 1710 } 1711 1712 /* Conversion function persistence */ 1713 enum H5T_pers_t { 1714 H5T_PERS_DONTCARE = -1, /*wild card */ 1715 H5T_PERS_HARD = 0, /*hard conversion function */ 1716 H5T_PERS_SOFT = 1 /*soft conversion function */ 1717 } 1718 1719 /* The order to retrieve atomic native datatype */ 1720 enum H5TDirection 1721 { 1722 Default = 0, /*default direction is inscendent */ 1723 Ascend = 1, /*in inscendent order */ 1724 Descend = 2 /*in descendent order */ 1725 } 1726 1727 /* The exception type passed into the conversion callback function */ 1728 enum H5T_conv_except_t { 1729 H5T_CONV_EXCEPT_RANGE_HI = 0, /*source value is greater than destination's range */ 1730 H5T_CONV_EXCEPT_RANGE_LOW = 1, /*source value is less than destination's range */ 1731 H5T_CONV_EXCEPT_PRECISION = 2, /*source value loses precision in destination */ 1732 H5T_CONV_EXCEPT_TRUNCATE = 3, /*source value is truncated in destination */ 1733 H5T_CONV_EXCEPT_PINF = 4, /*source value is positive infinity(floating number) */ 1734 H5T_CONV_EXCEPT_NINF = 5, /*source value is negative infinity(floating number) */ 1735 H5T_CONV_EXCEPT_NAN = 6 /*source value is NaN(floating number) */ 1736 } 1737 1738 /* The return value from conversion callback function H5T_conv_except_func_t */ 1739 enum H5T_conv_ret_t { 1740 H5T_CONV_ABORT = -1, /*abort conversion */ 1741 H5T_CONV_UNHANDLED = 0, /*callback function failed to handle the exception */ 1742 H5T_CONV_HANDLED = 1 /*callback function handled the exception successfully */ 1743 } 1744 1745 /* Variable Length Datatype struct in memory */ 1746 /* (This is only used for VL sequences, not VL strings, which are stored in char *'s) */ 1747 struct hvl_t { 1748 size_t len; /* Length of VL data (in base type units) */ 1749 void *p; /* Pointer to VL data */ 1750 } 1751 1752 /* Variable Length String information */ 1753 enum H5T_VARIABLE = (cast(size_t)(-1)); /* Indicate that a string is variable length (null-terminated in C, instead of fixed length) */ 1754 1755 /* Opaque information */ 1756 enum H5T_OPAQUE_TAG_MAX = 256; /* Maximum length of an opaque tag */ 1757 /* This could be raised without too much difficulty */ 1758 1759 extern(C) 1760 { 1761 /* All datatype conversion functions are... */ 1762 alias H5T_conv_t = herr_t function(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 1763 size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, 1764 void *bkg, hid_t dset_xfer_plist); 1765 1766 /* Exception handler. If an exception like overflow happenes during conversion, 1767 * this function is called if it's registered through H5Pset_type_conv_cb. 1768 */ 1769 alias H5T_conv_except_func_t = H5T_conv_ret_t function(H5T_conv_except_t except_type, 1770 hid_t src_id, hid_t dst_id, void *src_buf, void *dst_buf, void *user_data); 1771 1772 1773 /* 1774 * The IEEE floating point types in various byte orders. 1775 */ 1776 alias H5T_IEEE_F32BE = H5T_IEEE_F32BE_g; 1777 alias H5T_IEEE_F32LE = H5T_IEEE_F32LE_g; 1778 alias H5T_IEEE_F64BE = H5T_IEEE_F64BE_g; 1779 alias H5T_IEEE_F64LE = H5T_IEEE_F64LE_g; 1780 extern __gshared hid_t H5T_IEEE_F32BE_g; 1781 extern __gshared hid_t H5T_IEEE_F32LE_g; 1782 extern __gshared hid_t H5T_IEEE_F64BE_g; 1783 extern __gshared hid_t H5T_IEEE_F64LE_g; 1784 1785 /* 1786 * These are "standard" types. For instance, signed (2's complement) and 1787 * unsigned integers of various sizes and byte orders. 1788 */ 1789 alias H5T_STD_I8BE = H5T_STD_I8BE_g; 1790 alias H5T_STD_I8LE = H5T_STD_I8LE_g; 1791 alias H5T_STD_I16BE = H5T_STD_I16BE_g; 1792 alias H5T_STD_I16LE = H5T_STD_I16LE_g; 1793 alias H5T_STD_I32BE = H5T_STD_I32BE_g; 1794 alias H5T_STD_I32LE = H5T_STD_I32LE_g; 1795 alias H5T_STD_I64BE = H5T_STD_I64BE_g; 1796 alias H5T_STD_I64LE = H5T_STD_I64LE_g; 1797 alias H5T_STD_U8BE = H5T_STD_U8BE_g; 1798 alias H5T_STD_U8LE = H5T_STD_U8LE_g; 1799 alias H5T_STD_U16BE = H5T_STD_U16BE_g; 1800 alias H5T_STD_U16LE = H5T_STD_U16LE_g; 1801 alias H5T_STD_U32BE = H5T_STD_U32BE_g; 1802 alias H5T_STD_U32LE = H5T_STD_U32LE_g; 1803 alias H5T_STD_U64BE = H5T_STD_U64BE_g; 1804 alias H5T_STD_U64LE = H5T_STD_U64LE_g; 1805 alias H5T_STD_B8BE = H5T_STD_B8BE_g; 1806 alias H5T_STD_B8LE = H5T_STD_B8LE_g; 1807 alias H5T_STD_B16BE = H5T_STD_B16BE_g; 1808 alias H5T_STD_B16LE = H5T_STD_B16LE_g; 1809 alias H5T_STD_B32BE = H5T_STD_B32BE_g; 1810 alias H5T_STD_B32LE = H5T_STD_B32LE_g; 1811 alias H5T_STD_B64BE = H5T_STD_B64BE_g; 1812 alias H5T_STD_B64LE = H5T_STD_B64LE_g; 1813 alias H5T_STD_REF_OBJ = H5T_STD_REF_OBJ_g; 1814 alias H5T_STD_REF_DSETREG = H5T_STD_REF_DSETREG_g; 1815 extern __gshared hid_t H5T_STD_I8BE_g; 1816 extern __gshared hid_t H5T_STD_I8LE_g; 1817 extern __gshared hid_t H5T_STD_I16BE_g; 1818 extern __gshared hid_t H5T_STD_I16LE_g; 1819 extern __gshared hid_t H5T_STD_I32BE_g; 1820 extern __gshared hid_t H5T_STD_I32LE_g; 1821 extern __gshared hid_t H5T_STD_I64BE_g; 1822 extern __gshared hid_t H5T_STD_I64LE_g; 1823 extern __gshared hid_t H5T_STD_U8BE_g; 1824 extern __gshared hid_t H5T_STD_U8LE_g; 1825 extern __gshared hid_t H5T_STD_U16BE_g; 1826 extern __gshared hid_t H5T_STD_U16LE_g; 1827 extern __gshared hid_t H5T_STD_U32BE_g; 1828 extern __gshared hid_t H5T_STD_U32LE_g; 1829 extern __gshared hid_t H5T_STD_U64BE_g; 1830 extern __gshared hid_t H5T_STD_U64LE_g; 1831 extern __gshared hid_t H5T_STD_B8BE_g; 1832 extern __gshared hid_t H5T_STD_B8LE_g; 1833 extern __gshared hid_t H5T_STD_B16BE_g; 1834 extern __gshared hid_t H5T_STD_B16LE_g; 1835 extern __gshared hid_t H5T_STD_B32BE_g; 1836 extern __gshared hid_t H5T_STD_B32LE_g; 1837 extern __gshared hid_t H5T_STD_B64BE_g; 1838 extern __gshared hid_t H5T_STD_B64LE_g; 1839 extern __gshared hid_t H5T_STD_REF_OBJ_g; 1840 extern __gshared hid_t H5T_STD_REF_DSETREG_g; 1841 1842 /* 1843 * Types which are particular to Unix. 1844 */ 1845 alias H5T_UNIX_D32BE = H5T_UNIX_D32BE_g; 1846 alias H5T_UNIX_D32LE = H5T_UNIX_D32LE_g; 1847 alias H5T_UNIX_D64BE = H5T_UNIX_D64BE_g; 1848 alias H5T_UNIX_D64LE = H5T_UNIX_D64LE_g; 1849 extern __gshared hid_t H5T_UNIX_D32BE_g; 1850 extern __gshared hid_t H5T_UNIX_D32LE_g; 1851 extern __gshared hid_t H5T_UNIX_D64BE_g; 1852 extern __gshared hid_t H5T_UNIX_D64LE_g; 1853 1854 /* 1855 * Types particular to the C language. String types use `bytes' instead 1856 * of `bits' as their size. 1857 */ 1858 alias H5T_C_S1 = H5T_C_S1_g; 1859 extern __gshared hid_t H5T_C_S1_g; 1860 1861 /* 1862 * Types particular to Fortran. 1863 */ 1864 alias H5T_FORTRAN_S1 = H5T_FORTRAN_S1_g; 1865 extern __gshared hid_t H5T_FORTRAN_S1_g; 1866 1867 1868 /* 1869 * These types are for Intel CPU's. They are little endian with IEEE 1870 * floating point. 1871 */ 1872 alias H5T_INTEL_I8 = H5T_STD_I8LE; 1873 alias H5T_INTEL_I16 = H5T_STD_I16LE; 1874 alias H5T_INTEL_I32 = H5T_STD_I32LE; 1875 alias H5T_INTEL_I64 = H5T_STD_I64LE; 1876 alias H5T_INTEL_U8 = H5T_STD_U8LE; 1877 alias H5T_INTEL_U16 = H5T_STD_U16LE; 1878 alias H5T_INTEL_U32 = H5T_STD_U32LE; 1879 alias H5T_INTEL_U64 = H5T_STD_U64LE; 1880 alias H5T_INTEL_B8 = H5T_STD_B8LE; 1881 alias H5T_INTEL_B16 = H5T_STD_B16LE; 1882 alias H5T_INTEL_B32 = H5T_STD_B32LE; 1883 alias H5T_INTEL_B64 = H5T_STD_B64LE; 1884 alias H5T_INTEL_F32 = H5T_IEEE_F32LE; 1885 alias H5T_INTEL_F64 = H5T_IEEE_F64LE; 1886 1887 1888 /* 1889 * The VAX floating point types (i.e. in VAX byte order) 1890 */ 1891 alias H5T_VAX_F32 = H5T_VAX_F32_g; 1892 alias H5T_VAX_F64 = H5T_VAX_F64_g; 1893 extern __gshared hid_t H5T_VAX_F32_g; 1894 extern __gshared hid_t H5T_VAX_F64_g; 1895 alias H5T_NATIVE_SCHAR = H5T_NATIVE_SCHAR_g; 1896 alias H5T_NATIVE_UCHAR = H5T_NATIVE_UCHAR_g; 1897 alias H5T_NATIVE_SHORT = H5T_NATIVE_SHORT_g; 1898 alias H5T_NATIVE_USHORT = H5T_NATIVE_USHORT_g; 1899 alias H5T_NATIVE_INT = H5T_NATIVE_INT_g; 1900 alias H5T_NATIVE_UINT = H5T_NATIVE_UINT_g; 1901 alias H5T_NATIVE_LONG = H5T_NATIVE_LONG_g; 1902 alias H5T_NATIVE_ULONG = H5T_NATIVE_ULONG_g; 1903 alias H5T_NATIVE_LLONG = H5T_NATIVE_LLONG_g; 1904 alias H5T_NATIVE_ULLONG = H5T_NATIVE_ULLONG_g; 1905 alias H5T_NATIVE_FLOAT = H5T_NATIVE_FLOAT_g; 1906 alias H5T_NATIVE_DOUBLE = H5T_NATIVE_DOUBLE_g; 1907 alias H5T_NATIVE_B8 = H5T_NATIVE_B8_g; 1908 alias H5T_NATIVE_B16 = H5T_NATIVE_B16_g; 1909 alias H5T_NATIVE_B32 = H5T_NATIVE_B32_g; 1910 alias H5T_NATIVE_B64 = H5T_NATIVE_B64_g; 1911 alias H5T_NATIVE_OPAQUE = H5T_NATIVE_OPAQUE_g; 1912 alias H5T_NATIVE_HADDR = H5T_NATIVE_HADDR_g; 1913 alias H5T_NATIVE_HSIZE = H5T_NATIVE_HSIZE_g; 1914 alias H5T_NATIVE_HSSIZE = H5T_NATIVE_HSSIZE_g; 1915 alias H5T_NATIVE_HERR = H5T_NATIVE_HERR_g; 1916 alias H5T_NATIVE_HBOOL = H5T_NATIVE_HBOOL_g; 1917 extern __gshared hid_t H5T_NATIVE_SCHAR_g; 1918 extern __gshared hid_t H5T_NATIVE_UCHAR_g; 1919 extern __gshared hid_t H5T_NATIVE_SHORT_g; 1920 extern __gshared hid_t H5T_NATIVE_USHORT_g; 1921 extern __gshared hid_t H5T_NATIVE_INT_g; 1922 extern __gshared hid_t H5T_NATIVE_UINT_g; 1923 extern __gshared hid_t H5T_NATIVE_LONG_g; 1924 extern __gshared hid_t H5T_NATIVE_ULONG_g; 1925 extern __gshared hid_t H5T_NATIVE_LLONG_g; 1926 extern __gshared hid_t H5T_NATIVE_ULLONG_g; 1927 extern __gshared hid_t H5T_NATIVE_FLOAT_g; 1928 extern __gshared hid_t H5T_NATIVE_DOUBLE_g; 1929 static if ( H5_SIZEOF_LONG_DOUBLE !=0 ) { 1930 extern __gshared hid_t H5T_NATIVE_LDOUBLE_g; 1931 } 1932 extern __gshared hid_t H5T_NATIVE_B8_g; 1933 extern __gshared hid_t H5T_NATIVE_B16_g; 1934 extern __gshared hid_t H5T_NATIVE_B32_g; 1935 extern __gshared hid_t H5T_NATIVE_B64_g; 1936 extern __gshared hid_t H5T_NATIVE_OPAQUE_g; 1937 extern __gshared hid_t H5T_NATIVE_HADDR_g; 1938 extern __gshared hid_t H5T_NATIVE_HSIZE_g; 1939 extern __gshared hid_t H5T_NATIVE_HSSIZE_g; 1940 extern __gshared hid_t H5T_NATIVE_HERR_g; 1941 extern __gshared hid_t H5T_NATIVE_HBOOL_g; 1942 1943 /* C9x integer types */ 1944 alias H5T_NATIVE_INT8 = H5T_NATIVE_INT8_g; 1945 alias H5T_NATIVE_UINT8 = H5T_NATIVE_UINT8_g; 1946 alias H5T_NATIVE_INT_LEAST8 = H5T_NATIVE_INT_LEAST8_g; 1947 alias H5T_NATIVE_UINT_LEAST8 = H5T_NATIVE_UINT_LEAST8_g; 1948 alias H5T_NATIVE_INT_FAST8 = H5T_NATIVE_INT_FAST8_g; 1949 alias H5T_NATIVE_UINT_FAST8 = H5T_NATIVE_UINT_FAST8_g; 1950 extern __gshared hid_t H5T_NATIVE_INT8_g; 1951 extern __gshared hid_t H5T_NATIVE_UINT8_g; 1952 extern __gshared hid_t H5T_NATIVE_INT_LEAST8_g; 1953 extern __gshared hid_t H5T_NATIVE_UINT_LEAST8_g; 1954 extern __gshared hid_t H5T_NATIVE_INT_FAST8_g; 1955 extern __gshared hid_t H5T_NATIVE_UINT_FAST8_g; 1956 1957 alias H5T_NATIVE_INT16 = H5T_NATIVE_INT16_g; 1958 alias H5T_NATIVE_UINT16 = H5T_NATIVE_UINT16_g; 1959 alias H5T_NATIVE_INT_LEAST16 = H5T_NATIVE_INT_LEAST16_g; 1960 alias H5T_NATIVE_UINT_LEAST16 = H5T_NATIVE_UINT_LEAST16_g; 1961 alias H5T_NATIVE_INT_FAST16 = H5T_NATIVE_INT_FAST16_g; 1962 alias H5T_NATIVE_UINT_FAST16 = H5T_NATIVE_UINT_FAST16_g; 1963 extern __gshared hid_t H5T_NATIVE_INT16_g; 1964 extern __gshared hid_t H5T_NATIVE_UINT16_g; 1965 extern __gshared hid_t H5T_NATIVE_INT_LEAST16_g; 1966 extern __gshared hid_t H5T_NATIVE_UINT_LEAST16_g; 1967 extern __gshared hid_t H5T_NATIVE_INT_FAST16_g; 1968 extern __gshared hid_t H5T_NATIVE_UINT_FAST16_g; 1969 1970 alias H5T_NATIVE_INT32 = H5T_NATIVE_INT32_g; 1971 alias H5T_NATIVE_UINT32 = H5T_NATIVE_UINT32_g; 1972 alias H5T_NATIVE_INT_LEAST32 = H5T_NATIVE_INT_LEAST32_g; 1973 alias H5T_NATIVE_UINT_LEAST32 = H5T_NATIVE_UINT_LEAST32_g; 1974 alias H5T_NATIVE_INT_FAST32 = H5T_NATIVE_INT_FAST32_g; 1975 alias H5T_NATIVE_UINT_FAST32 = H5T_NATIVE_UINT_FAST32_g; 1976 extern __gshared hid_t H5T_NATIVE_INT32_g; 1977 extern __gshared hid_t H5T_NATIVE_UINT32_g; 1978 extern __gshared hid_t H5T_NATIVE_INT_LEAST32_g; 1979 extern __gshared hid_t H5T_NATIVE_UINT_LEAST32_g; 1980 extern __gshared hid_t H5T_NATIVE_INT_FAST32_g; 1981 extern __gshared hid_t H5T_NATIVE_UINT_FAST32_g; 1982 1983 alias H5T_NATIVE_INT64 = H5T_NATIVE_INT64_g; 1984 alias H5T_NATIVE_UINT64 = H5T_NATIVE_UINT64_g; 1985 alias H5T_NATIVE_INT_LEAST64 = H5T_NATIVE_INT_LEAST64_g; 1986 alias H5T_NATIVE_UINT_LEAST64 = H5T_NATIVE_UINT_LEAST64_g; 1987 alias H5T_NATIVE_INT_FAST64 = H5T_NATIVE_INT_FAST64_g; 1988 alias H5T_NATIVE_UINT_FAST64 = H5T_NATIVE_UINT_FAST64_g; 1989 extern __gshared hid_t H5T_NATIVE_INT64_g; 1990 extern __gshared hid_t H5T_NATIVE_UINT64_g; 1991 extern __gshared hid_t H5T_NATIVE_INT_LEAST64_g; 1992 extern __gshared hid_t H5T_NATIVE_UINT_LEAST64_g; 1993 extern __gshared hid_t H5T_NATIVE_INT_FAST64_g; 1994 extern __gshared hid_t H5T_NATIVE_UINT_FAST64_g; 1995 1996 version(Posix) { 1997 1998 /* Operations defined on all datatypes */ 1999 hid_t H5Tcreate(H5TClass type, size_t size); 2000 hid_t H5Tcopy(hid_t type_id); 2001 herr_t H5Tclose(hid_t type_id); 2002 htri_t H5Tequal(hid_t type1_id, hid_t type2_id); 2003 herr_t H5Tlock(hid_t type_id); 2004 herr_t H5Tcommit2(hid_t loc_id, const char *name, hid_t type_id, 2005 hid_t lcpl_id, hid_t tcpl_id, hid_t tapl_id); 2006 hid_t H5Topen2(hid_t loc_id, const char *name, hid_t tapl_id); 2007 herr_t H5Tcommit_anon(hid_t loc_id, hid_t type_id, hid_t tcpl_id, hid_t tapl_id); 2008 hid_t H5Tget_create_plist(hid_t type_id); 2009 htri_t H5Tcommitted(hid_t type_id); 2010 herr_t H5Tencode(hid_t obj_id, void *buf, size_t *nalloc); 2011 hid_t H5Tdecode(const void *buf); 2012 2013 /* Operations defined on compound datatypes */ 2014 herr_t H5Tinsert(hid_t parent_id, const char *name, size_t offset, 2015 hid_t member_id); 2016 herr_t H5Tpack(hid_t type_id); 2017 2018 /* Operations defined on enumeration datatypes */ 2019 hid_t H5Tenum_create(hid_t base_id); 2020 herr_t H5Tenum_insert(hid_t type, const char *name, const void *value); 2021 herr_t H5Tenum_nameof(hid_t type, const void *value, char *name/*out*/, 2022 size_t size); 2023 herr_t H5Tenum_valueof(hid_t type, const char *name, 2024 void *value/*out*/); 2025 2026 /* Operations defined on variable-length datatypes */ 2027 hid_t H5Tvlen_create(hid_t base_id); 2028 2029 /* Operations defined on array datatypes */ 2030 hid_t H5Tarray_create2(hid_t base_id, uint ndims, 2031 const hsize_t dim[/* ndims */]); 2032 int H5Tget_array_ndims(hid_t type_id); 2033 int H5Tget_array_dims2(hid_t type_id, hsize_t* dims); 2034 2035 /* Operations defined on opaque datatypes */ 2036 herr_t H5Tset_tag(hid_t type, const char *tag); 2037 char *H5Tget_tag(hid_t type); 2038 2039 /* Querying property values */ 2040 hid_t H5Tget_super(hid_t type); 2041 H5TClass H5Tget_class(hid_t type_id); 2042 htri_t H5Tdetect_class(hid_t type_id, H5TClass cls); 2043 size_t H5Tget_size(hid_t type_id); 2044 H5TByteOrder H5Tget_order(hid_t type_id); 2045 size_t H5Tget_precision(hid_t type_id); 2046 int H5Tget_offset(hid_t type_id); 2047 herr_t H5Tget_pad(hid_t type_id, H5T_pad_t *lsb/*out*/, 2048 H5T_pad_t *msb/*out*/); 2049 H5T_sign_t H5Tget_sign(hid_t type_id); 2050 herr_t H5Tget_fields(hid_t type_id, size_t *spos/*out*/, 2051 size_t *epos/*out*/, size_t *esize/*out*/, 2052 size_t *mpos/*out*/, size_t *msize/*out*/); 2053 size_t H5Tget_ebias(hid_t type_id); 2054 H5T_norm_t H5Tget_norm(hid_t type_id); 2055 H5T_pad_t H5Tget_inpad(hid_t type_id); 2056 H5TString H5Tget_strpad(hid_t type_id); 2057 int H5Tget_nmembers(hid_t type_id); 2058 char *H5Tget_member_name(hid_t type_id, uint membno); 2059 int H5Tget_member_index(hid_t type_id, const char *name); 2060 size_t H5Tget_member_offset(hid_t type_id, uint membno); 2061 H5TClass H5Tget_member_class(hid_t type_id, uint membno); 2062 hid_t H5Tget_member_type(hid_t type_id, uint membno); 2063 herr_t H5Tget_member_value(hid_t type_id, uint membno, void *value/*out*/); 2064 H5TCset H5Tget_cset(hid_t type_id); 2065 htri_t H5Tis_variable_str(hid_t type_id); 2066 hid_t H5Tget_native_type(hid_t type_id, H5TDirection direction); 2067 2068 /* Setting property values */ 2069 herr_t H5Tset_size(hid_t type_id, size_t size); 2070 herr_t H5Tset_order(hid_t type_id, H5TByteOrder order); 2071 herr_t H5Tset_precision(hid_t type_id, size_t prec); 2072 herr_t H5Tset_offset(hid_t type_id, size_t offset); 2073 herr_t H5Tset_pad(hid_t type_id, H5T_pad_t lsb, H5T_pad_t msb); 2074 herr_t H5Tset_sign(hid_t type_id, H5T_sign_t sign); 2075 herr_t H5Tset_fields(hid_t type_id, size_t spos, size_t epos, 2076 size_t esize, size_t mpos, size_t msize); 2077 herr_t H5Tset_ebias(hid_t type_id, size_t ebias); 2078 herr_t H5Tset_norm(hid_t type_id, H5T_norm_t norm); 2079 herr_t H5Tset_inpad(hid_t type_id, H5T_pad_t pad); 2080 herr_t H5Tset_cset(hid_t type_id, H5TCset cset); 2081 herr_t H5Tset_strpad(hid_t type_id, H5TString strpad); 2082 2083 /* Type conversion database */ 2084 herr_t H5Tregister(H5T_pers_t pers, const char *name, hid_t src_id, 2085 hid_t dst_id, H5T_conv_t func); 2086 herr_t H5Tunregister(H5T_pers_t pers, const char *name, hid_t src_id, 2087 hid_t dst_id, H5T_conv_t func); 2088 H5T_conv_t H5Tfind(hid_t src_id, hid_t dst_id, H5T_cdata_t **pcdata); 2089 htri_t H5Tcompiler_conv(hid_t src_id, hid_t dst_id); 2090 herr_t H5Tconvert(hid_t src_id, hid_t dst_id, size_t nelmts, 2091 void *buf, void *background, hid_t plist_id); 2092 } 2093 } 2094 2095 // alias H5ZFilter = int; 2096 2097 /* Filter IDs */ 2098 enum H5ZFilter 2099 { 2100 Error = (-1), /*no filter */ 2101 None = 0, /*reserved indefinitely */ 2102 Deflate = 1, /*deflation like gzip */ 2103 Shuffle = 2, /*shuffle the data */ 2104 Fletcher32 = 3, /*fletcher32 checksum of EDC */ 2105 SZip = 4, /*szip compression */ 2106 NBit = 5, /*nbit compression */ 2107 ScaleOffset = 6, /*scale+offset compression */ 2108 Reserved = 256, /*filter ids below this value are reserved for library use */ 2109 Max = 65535, /*maximum filter id */ 2110 All = 0, /* Symbol to remove all filters in H5Premove_filter */ 2111 } 2112 2113 enum H5Z_MAX_NFILTERS = 32; /* Maximum number of filters allowed in a pipeline */ 2114 /* (should probably be allowed to be an 2115 * unlimited amount, but currently each 2116 * filter uses a bit in a 32-bit field, 2117 * so the format would have to be 2118 * changed to accomodate that) 2119 */ 2120 2121 /* Flags for filter definition (stored) */ 2122 enum H5Z_FLAG_DEFMASK = 0x00ff; /*definition flag mask */ 2123 enum H5Z_FLAG_MANDATORY = 0x0000; /*filter is mandatory */ 2124 enum H5Z_FLAG_OPTIONAL = 0x0001; /*filter is optional */ 2125 2126 /* Additional flags for filter invocation (not stored) */ 2127 enum H5Z_FLAG_INVMASK = 0xff00; /*invocation flag mask */ 2128 enum H5Z_FLAG_REVERSE = 0x0100; /*reverse direction; read */ 2129 enum H5Z_FLAG_SKIP_EDC = 0x0200; /*skip EDC filters for read */ 2130 2131 /* Special parameters for szip compression */ 2132 /* [These are aliases for the similar definitions in szlib.h, which we can't 2133 * include directly due to the duplication of various symbols with the zlib.h 2134 * header file] */ 2135 enum H5_SZIP_ALLOW_K13_OPTION_MASK = 1; 2136 enum H5_SZIP_CHIP_OPTION_MASK = 2; 2137 enum H5_SZIP_EC_OPTION_MASK = 4; 2138 enum H5_SZIP_NN_OPTION_MASK = 32; 2139 enum H5_SZIP_MAX_PIXELS_PER_BLOCK = 32; 2140 2141 /* Macros for the shuffle filter */ 2142 enum H5Z_SHUFFLE_USER_NPARMS = 0; /* Number of parameters that users can set */ 2143 enum H5Z_SHUFFLE_TOTAL_NPARMS = 1; /* Total number of parameters for filter */ 2144 2145 /* Macros for the szip filter */ 2146 enum H5Z_SZIP_USER_NPARMS = 2; /* Number of parameters that users can set */ 2147 enum H5Z_SZIP_TOTAL_NPARMS = 4; /* Total number of parameters for filter */ 2148 enum H5Z_SZIP_PARM_MASK = 0; /* "User" parameter for option mask */ 2149 enum H5Z_SZIP_PARM_PPB = 1; /* "User" parameter for pixels-per-block */ 2150 enum H5Z_SZIP_PARM_BPP = 2; /* "Local" parameter for bits-per-pixel */ 2151 enum H5Z_SZIP_PARM_PPS = 3; /* "Local" parameter for pixels-per-scanline */ 2152 2153 /* Macros for the nbit filter */ 2154 enum H5Z_NBIT_USER_NPARMS = 0; /* Number of parameters that users can set */ 2155 2156 /* Macros for the scale offset filter */ 2157 enum H5Z_SCALEOFFSET_USER_NPARMS = 2; /* Number of parameters that users can set */ 2158 2159 /* Special parameters for ScaleOffset filter*/ 2160 enum H5Z_SO_INT_MINBITS_DEFAULT = 0; 2161 enum H5Z_SO_scale_type_t { 2162 H5Z_SO_FLOAT_DSCALE = 0, 2163 H5Z_SO_FLOAT_ESCALE = 1, 2164 H5Z_SO_INT = 2 2165 } 2166 2167 /* Current version of the H5Z_class_t struct */ 2168 enum H5Z_CLASS_T_VERS = (1); 2169 2170 /* Values to decide if EDC is enabled for reading data */ 2171 enum H5Z_EDC_t { 2172 H5Z_ERROR_EDC = -1, /* error value */ 2173 H5Z_DISABLE_EDC = 0, 2174 H5Z_ENABLE_EDC = 1, 2175 H5Z_NO_EDC = 2 /* must be the last */ 2176 } 2177 2178 /* Bit flags for H5Zget_filter_info */ 2179 enum H5Z_FILTER_CONFIG_ENCODE_ENABLED = (0x0001); 2180 enum H5Z_FILTER_CONFIG_DECODE_ENABLED = (0x0002); 2181 2182 /* Return values for filter callback function */ 2183 enum H5Z_cb_return_t { 2184 H5Z_CB_ERROR = -1, 2185 H5Z_CB_FAIL = 0, /* I/O should fail if filter fails. */ 2186 H5Z_CB_CONT = 1, /* I/O continues if filter fails. */ 2187 H5Z_CB_NO = 2 2188 } 2189 2190 extern(C) 2191 { 2192 /* Filter callback function definition */ 2193 alias H5Z_filter_func_t = H5Z_cb_return_t function(H5ZFilter filter, void* buf, 2194 size_t buf_size, void* op_data); 2195 2196 /* Structure for filter callback property */ 2197 struct H5Z_cb_t { 2198 H5Z_filter_func_t func; 2199 void* op_data; 2200 } 2201 alias H5Z_can_apply_func_t = htri_t function(hid_t dcpl_id, hid_t type_id, hid_t space_id); 2202 alias H5Z_set_local_func_t = herr_t function(hid_t dcpl_id, hid_t type_id, hid_t space_id); 2203 alias H5Z_func_t = size_t function(uint flags, size_t cd_nelmts, const uint* cd_values, size_t nbytes, size_t *buf_size, void **buf); 2204 2205 struct H5Z_class2_t { 2206 int _version; /* Version number of the H5Z_class_t struct */ 2207 H5ZFilter id; /* Filter ID number */ 2208 int encoder_present; /* Does this filter have an encoder? */ 2209 int decoder_present; /* Does this filter have a decoder? */ 2210 const char *name; /* Comment for debugging */ 2211 H5Z_can_apply_func_t can_apply; /* The "can apply" callback for a filter */ 2212 H5Z_set_local_func_t set_local; /* The "set local" callback for a filter */ 2213 H5Z_func_t filter; /* The actual filter function */ 2214 } 2215 2216 herr_t H5Zregister(const void *cls); 2217 herr_t H5Zunregister(H5ZFilter id); 2218 htri_t H5Zfilter_avail(H5ZFilter id); 2219 herr_t H5Zget_filter_info(H5ZFilter filter, uint *filter_config_flags); 2220 } 2221 2222 2223 alias MPI_Datatype = int; 2224 alias MPI_Comm = int; 2225 alias MPI_Info = int; 2226 enum MPI_LONG_LONG_INT = cast(MPI_Datatype) 0x4c000809; 2227 enum H5_CLEAR_MEMORY = 1; 2228 enum H5_CONVERT_DENORMAL_FLOAT = 1; 2229 enum H5_DEFAULT_PLUGINDIR = "/usr/local/hdf5/lib/plugin"; 2230 enum H5_DEV_T_IS_SCALAR = 1; 2231 enum H5_FP_TO_INTEGER_OVERFLOW_WORKS = 1; 2232 enum H5_FP_TO_ULLONG_ACCURATE = 1; 2233 enum H5_FP_TO_ULLONG_RIGHT_MAXIMUM = 1; 2234 enum H5_GETTIMEOFDAY_GIVES_TZ = 1; 2235 enum H5_HAVE_ALARM = 1; 2236 enum H5_HAVE_ATTRIBUTE = 1; 2237 enum H5_HAVE_C99_DESIGNATED_INITIALIZER = 1; 2238 enum H5_HAVE_C99_FUNC = 1; 2239 enum H5_HAVE_CLOCK_GETTIME = 1; 2240 enum H5_HAVE_DIFFTIME = 1; 2241 enum H5_HAVE_DIRENT_H = 1; 2242 enum H5_HAVE_DLFCN_H = 1; 2243 enum H5_HAVE_EMBEDDED_LIBINFO = 1; 2244 enum H5_HAVE_FEATURES_H = 1; 2245 enum H5_HAVE_FILTER_DEFLATE = 1; 2246 enum H5_HAVE_FILTER_FLETCHER32 = 1; 2247 enum H5_HAVE_FILTER_NBIT = 1; 2248 enum H5_HAVE_FILTER_SCALEOFFSET = 1; 2249 enum H5_HAVE_FILTER_SHUFFLE = 1; 2250 enum H5_HAVE_FORK = 1; 2251 enum H5_HAVE_FREXPF = 1; 2252 enum H5_HAVE_FREXPL = 1; 2253 enum H5_HAVE_FSEEKO = 1; 2254 enum H5_HAVE_FSEEKO64 = 1; 2255 enum H5_HAVE_FSTAT64 = 1; 2256 enum H5_HAVE_FTELLO = 1; 2257 enum H5_HAVE_FTELLO64 = 1; 2258 enum H5_HAVE_FTRUNCATE64 = 1; 2259 enum H5_HAVE_FUNCTION = 1; 2260 enum H5_HAVE_GETHOSTNAME = 1; 2261 enum H5_HAVE_GETPWUID = 1; 2262 enum H5_HAVE_GETRUSAGE = 1; 2263 enum H5_HAVE_GETTIMEOFDAY = 1; 2264 enum H5_HAVE_INTTYPES_H = 1; 2265 enum H5_HAVE_IOCTL = 1; 2266 enum H5_HAVE_LIBDL = 1; 2267 enum H5_HAVE_LIBM = 1; 2268 enum H5_HAVE_LIBZ = 1; 2269 enum H5_HAVE_LONGJMP = 1; 2270 enum H5_HAVE_LSEEK64 = 1; 2271 enum H5_HAVE_LSTAT = 1; 2272 enum H5_HAVE_MEMORY_H = 1; 2273 enum H5_HAVE_MPI_GET_SIZE = 1; 2274 enum H5_HAVE_MPI_MULTI_LANG_Comm = 1; 2275 enum H5_HAVE_MPI_MULTI_LANG_Info = 1; 2276 enum H5_HAVE_PARALLEL = 1; 2277 enum H5_HAVE_RANDOM = 1; 2278 enum H5_HAVE_RAND_R = 1; 2279 enum H5_HAVE_SETJMP = 1; 2280 enum H5_HAVE_SETJMP_H = 1; 2281 enum H5_HAVE_SIGLONGJMP = 1; 2282 enum H5_HAVE_SIGNAL = 1; 2283 enum H5_HAVE_SIGPROCMASK = 1; 2284 enum H5_HAVE_SNPRINTF = 1; 2285 enum H5_HAVE_SRANDOM = 1; 2286 enum H5_HAVE_STAT64 = 1; 2287 enum H5_HAVE_STAT_ST_BLOCKS = 1; 2288 enum H5_HAVE_STDDEF_H = 1; 2289 enum H5_HAVE_STDINT_H = 1; 2290 enum H5_HAVE_STDLIB_H = 1; 2291 enum H5_HAVE_STRDUP = 1; 2292 enum H5_HAVE_STRINGS_H = 1; 2293 enum H5_HAVE_STRING_H = 1; 2294 enum H5_HAVE_STRUCT_TIMEZONE = 1; 2295 enum H5_HAVE_STRUCT_TM_TM_ZONE = 1; 2296 enum H5_HAVE_SYMLINK = 1; 2297 enum H5_HAVE_SYSTEM = 1; 2298 enum H5_HAVE_SYS_IOCTL_H = 1; 2299 enum H5_HAVE_SYS_RESOURCE_H = 1; 2300 enum H5_HAVE_SYS_SOCKET_H = 1; 2301 enum H5_HAVE_SYS_STAT_H = 1; 2302 enum H5_HAVE_SYS_TIMEB_H = 1; 2303 enum H5_HAVE_SYS_TIME_H = 1; 2304 enum H5_HAVE_SYS_TYPES_H = 1; 2305 enum H5_HAVE_TIOCGETD = 1; 2306 enum H5_HAVE_TIOCGWINSZ = 1; 2307 enum H5_HAVE_TMPFILE = 1; 2308 enum H5_HAVE_TM_GMTOFF = 1; 2309 enum H5_HAVE_TM_ZONE = 1; 2310 enum H5_HAVE_UNISTD_H = 1; 2311 enum H5_HAVE_VASPRINTF = 1; 2312 enum H5_HAVE_VSNPRINTF = 1; 2313 enum H5_HAVE_WAITPID = 1; 2314 enum H5_HAVE_ZLIB_H = 1; 2315 enum H5_INCLUDE_HL = 1; 2316 enum H5_INTEGER_TO_LDOUBLE_ACCURATE = 1; 2317 enum H5_LDOUBLE_TO_INTEGER_ACCURATE = 1; 2318 enum H5_LDOUBLE_TO_INTEGER_WORKS = 1; 2319 enum H5_LDOUBLE_TO_LLONG_ACCURATE = 1; 2320 enum H5_LDOUBLE_TO_UINT_ACCURATE = 1; 2321 enum H5_LLONG_TO_FP_CAST_WORKS = 1; 2322 enum H5_LLONG_TO_LDOUBLE_CORRECT = 1; 2323 enum H5_LT_OBJDIR = ".libs/"; 2324 enum H5_MPI_FILE_SET_SIZE_BIG = 1; 2325 enum H5_NO_ALIGNMENT_RESTRICTIONS = 1; 2326 enum H5_PACKAGE = "hdf5"; 2327 enum H5_PACKAGE_BUGREPORT = "help@hdfgroup.org"; 2328 enum H5_PACKAGE_NAME = "HDF5"; 2329 enum H5_PACKAGE_STRING = "HDF5 1.8.13"; 2330 enum H5_PACKAGE_TARNAME = "hdf5"; 2331 enum H5_PACKAGE_URL = ""; 2332 enum H5_PACKAGE_VERSION = "1.8.13"; 2333 enum H5_PRINTF_LL_WIDTH = "l"; 2334 enum H5_SIZEOF_CHAR = 1; 2335 enum H5_SIZEOF_DOUBLE = 8; 2336 enum H5_SIZEOF_FLOAT = 4; 2337 enum H5_SIZEOF_INT = 4; 2338 enum H5_SIZEOF_INT16_T = 2; 2339 enum H5_SIZEOF_INT32_T = 4; 2340 enum H5_SIZEOF_INT64_T = 8; 2341 enum H5_SIZEOF_INT8_T = 1; 2342 enum H5_SIZEOF_INT_FAST16_T = 8; 2343 enum H5_SIZEOF_INT_FAST32_T = 8; 2344 enum H5_SIZEOF_INT_FAST64_T = 8; 2345 enum H5_SIZEOF_INT_FAST8_T = 1; 2346 enum H5_SIZEOF_INT_LEAST16_T = 2; 2347 enum H5_SIZEOF_INT_LEAST32_T = 4; 2348 enum H5_SIZEOF_INT_LEAST64_T = 8; 2349 enum H5_SIZEOF_INT_LEAST8_T = 1; 2350 enum H5_SIZEOF_LONG = 8; 2351 enum H5_SIZEOF_LONG_DOUBLE = 16; 2352 enum H5_SIZEOF_LONG_LONG = 8; 2353 enum H5_SIZEOF_OFF64_T = 8; 2354 enum H5_SIZEOF_OFF_T = 8; 2355 enum H5_SIZEOF_PTRDIFF_T = 8; 2356 enum H5_SIZEOF_SHORT = 2; 2357 enum H5_SIZEOF_SIZE_T = 8; 2358 enum H5_SIZEOF_SSIZE_T = 8; 2359 enum H5_SIZEOF_UINT16_T = 2; 2360 enum H5_SIZEOF_UINT32_T = 4; 2361 enum H5_SIZEOF_UINT64_T = 8; 2362 enum H5_SIZEOF_UINT8_T = 1; 2363 enum H5_SIZEOF_UINT_FAST16_T = 8; 2364 enum H5_SIZEOF_UINT_FAST32_T = 8; 2365 enum H5_SIZEOF_UINT_FAST64_T = 8; 2366 enum H5_SIZEOF_UINT_FAST8_T = 1; 2367 enum H5_SIZEOF_UINT_LEAST16_T = 2; 2368 enum H5_SIZEOF_UINT_LEAST32_T = 4; 2369 enum H5_SIZEOF_UINT_LEAST64_T = 8; 2370 enum H5_SIZEOF_UINT_LEAST8_T = 1; 2371 enum H5_SIZEOF_UNSIGNED = 4; 2372 enum H5_SIZEOF___INT64 = 0; 2373 enum H5_STDC_HEADERS = 1; 2374 enum H5_SYSTEM_SCOPE_THREADS = 1; 2375 enum H5_TIME_WITH_SYS_TIME = 1; 2376 enum H5_ULLONG_TO_FP_CAST_WORKS = 1; 2377 enum H5_ULLONG_TO_LDOUBLE_PRECISION = 1; 2378 enum H5_ULONG_TO_FLOAT_ACCURATE = 1; 2379 enum H5_ULONG_TO_FP_BOTTOM_BIT_ACCURATE = 1; 2380 enum H5_VERSION = "1.8.13"; 2381 enum H5_VSNPRINTF_WORKS = 1; 2382 enum H5_WANT_DATA_ACCURACY = 1; 2383 enum H5_WANT_DCONV_EXCEPTION = 1; 2384 enum WORDS_BIGENDIAN = 0; 2385 2386 2387 struct H5A 2388 { 2389 static { 2390 hid_t create2(hid_t loc_id, string attr_name, hid_t type_id, hid_t space_id, hid_t acpl_id, hid_t aapl_id) 2391 { 2392 return H5Acreate2(loc_id,toStringz(attr_name),type_id,space_id,acpl_id,aapl_id); 2393 } 2394 2395 2396 hid_t create_by_name(hid_t loc_id, string obj_name, string attr_name,hid_t type_id, hid_t space_id, hid_t acpl_id, hid_t aapl_id, hid_t lapl_id) 2397 2398 { 2399 return H5Acreate_by_name(loc_id,toStringz(obj_name),toStringz(attr_name),type_id,space_id,acpl_id,aapl_id,lapl_id); 2400 } 2401 2402 hid_t open(hid_t obj_id, string attr_name, hid_t aapl_id) 2403 { 2404 return H5Aopen(obj_id,toStringz(attr_name),aapl_id); 2405 } 2406 2407 2408 hid_t open_by_name(hid_t loc_id, string obj_name, string attr_name, hid_t aapl_id, hid_t lapl_id) 2409 { 2410 return H5Aopen_by_name(loc_id,toStringz(obj_name), toStringz(attr_name),aapl_id,lapl_id); 2411 } 2412 2413 2414 hid_t open_by_idx(hid_t loc_id, string obj_name, H5Index idx_type, H5IterOrder order, hsize_t n, hid_t aapl_id, hid_t lapl_id) 2415 { 2416 return H5Aopen_by_idx(loc_id,toStringz(obj_name),idx_type,order,n,aapl_id,lapl_id); 2417 } 2418 2419 2420 void write(hid_t attr_id, hid_t type_id, const (ubyte*) buf) 2421 { 2422 throwOnError(H5Awrite(attr_id,type_id,buf)); 2423 } 2424 2425 2426 void read(hid_t attr_id, hid_t type_id, ubyte* buf) 2427 { 2428 throwOnError(H5Aread(attr_id,type_id,buf)); 2429 } 2430 2431 2432 void close(hid_t attr_id) 2433 { 2434 throwOnError( H5Aclose(attr_id)); 2435 } 2436 2437 2438 hid_t get_space(hid_t attr_id) 2439 { 2440 return H5Aget_space(attr_id); 2441 } 2442 2443 2444 hid_t get_type(hid_t attr_id) 2445 { 2446 return H5Aget_type(attr_id); 2447 } 2448 2449 2450 hid_t get_create_plist(hid_t attr_id) 2451 { 2452 return H5Aget_create_plist(attr_id); 2453 } 2454 2455 2456 string get_name(hid_t attr_id) 2457 { 2458 char[2048] buf; 2459 if (H5Aget_name(attr_id,buf.length,cast(char*)buf)<=0) 2460 return ""; 2461 else 2462 return ZtoString(buf[]); 2463 } 2464 2465 2466 string get_name_by_idx(hid_t loc_id, string obj_name, H5Index idx_type, H5IterOrder order, hsize_t n, hid_t lapl_id) 2467 { 2468 char[2048] buf; 2469 if (H5Aget_name_by_idx(loc_id,toStringz(obj_name),idx_type,order,n,cast(char*)buf,buf.length,lapl_id)<=0) 2470 return ""; 2471 else 2472 return ZtoString(buf[]); 2473 } 2474 2475 2476 hsize_t get_storage_size(hid_t attr_id) 2477 { 2478 return H5Aget_storage_size(attr_id); 2479 } 2480 2481 2482 void get_info(hid_t attr_id, H5A_info_t *ainfo /*out*/) 2483 { 2484 throwOnError( H5Aget_info(attr_id,ainfo)); 2485 } 2486 2487 2488 void get_info_by_name(hid_t loc_id, string obj_name, string attr_name, H5A_info_t *ainfo /*out*/, hid_t lapl_id) 2489 { 2490 throwOnError( H5Aget_info_by_name(loc_id,toStringz(obj_name),toStringz(attr_name),ainfo,lapl_id)); 2491 } 2492 2493 2494 void get_info_by_idx(hid_t loc_id, string obj_name, H5Index idx_type, H5IterOrder order, hsize_t n, H5A_info_t *ainfo /*out*/, hid_t lapl_id) 2495 { 2496 throwOnError( H5Aget_info_by_idx(loc_id,toStringz(obj_name),idx_type,order,n,ainfo,lapl_id)); 2497 } 2498 2499 2500 void rename(hid_t loc_id, string old_name, string new_name) 2501 { 2502 throwOnError( H5Arename(loc_id,toStringz(old_name),toStringz(new_name))); 2503 } 2504 2505 2506 void rename_by_name(hid_t loc_id, string obj_name, string old_attr_name, string new_attr_name, hid_t lapl_id) 2507 { 2508 throwOnError( H5Arename_by_name(loc_id,toStringz(obj_name),toStringz(old_attr_name),toStringz(new_attr_name),lapl_id)); 2509 } 2510 2511 2512 void iterate2(hid_t loc_id, H5Index idx_type, H5IterOrder order, hsize_t *idx, H5A_operator2_t op, void *op_data) 2513 { 2514 throwOnError(H5Aiterate2(loc_id,idx_type,order,idx,op,op_data)); 2515 } 2516 2517 void iterate_by_name(hid_t loc_id, string obj_name, H5Index idx_type, H5IterOrder order, hsize_t *idx, H5A_operator2_t op, void *op_data, hid_t lapd_id) 2518 { 2519 throwOnError(H5Aiterate_by_name(loc_id, toStringz(obj_name),idx_type,order,idx, op,op_data,lapd_id)); 2520 } 2521 2522 void h5delete(hid_t loc_id, string name) 2523 { 2524 throwOnError( H5Adelete(loc_id,toStringz(name))); 2525 } 2526 2527 2528 void delete_by_name(hid_t loc_id, string obj_name, string attr_name, hid_t lapl_id) 2529 { 2530 throwOnError( H5Adelete_by_name(loc_id,toStringz(obj_name),toStringz(attr_name),lapl_id)); 2531 } 2532 2533 2534 void delete_by_idx(hid_t loc_id, string obj_name, H5Index idx_type, H5IterOrder order, hsize_t n, hid_t lapl_id) 2535 { 2536 throwOnError( H5Adelete_by_idx(loc_id,toStringz(obj_name),idx_type,order,n,lapl_id)); 2537 } 2538 2539 2540 htri_t exists(hid_t obj_id, string attr_name) 2541 { 2542 return H5Aexists(obj_id,toStringz(attr_name)); 2543 } 2544 2545 2546 htri_t exists_by_name(hid_t obj_id, string obj_name, string attr_name, hid_t lapl_id) 2547 { 2548 return H5Aexists_by_name(obj_id,toStringz(obj_name),toStringz(attr_name),lapl_id); 2549 } 2550 } // static 2551 } 2552 2553 2554 struct H5D 2555 { 2556 static 2557 { 2558 // alias - hope it is correct! 2559 hid_t create2(hid_t loc_id, string name, hid_t type_id, hid_t space_id, hid_t lcpl_id, hid_t dcpl_id, hid_t dapl_id) 2560 { 2561 return H5Dcreate2(loc_id, toStringz(name), type_id, space_id, lcpl_id, dcpl_id, dapl_id); 2562 } 2563 2564 hid_t create_anon(hid_t file_id, hid_t type_id, hid_t space_id, hid_t plist_id, hid_t dapl_id) 2565 { 2566 return H5Dcreate_anon( file_id, type_id, space_id, plist_id, dapl_id); 2567 } 2568 hid_t open2(hid_t file_id, string name, hid_t dapl_id) 2569 { 2570 return H5Dopen2( file_id, toStringz(name), dapl_id); 2571 } 2572 void close(hid_t dset_id) 2573 { 2574 throwOnError(H5Dclose(dset_id)); 2575 } 2576 hid_t get_space(hid_t dset_id) 2577 { 2578 return H5Dget_space(dset_id); 2579 } 2580 H5DSpaceStatus get_space_status(hid_t dset_id) 2581 { 2582 H5DSpaceStatus allocation; 2583 throwOnError(H5Dget_space_status(dset_id, &allocation)); 2584 return allocation; 2585 } 2586 hid_t get_type(hid_t dset_id) 2587 { 2588 return H5Dget_type(dset_id); 2589 } 2590 2591 hid_t get_create_plist(hid_t dset_id) 2592 { 2593 return H5Dget_create_plist(dset_id); 2594 } 2595 hid_t get_access_plist(hid_t dset_id) 2596 { 2597 return H5Dget_access_plist(dset_id); 2598 } 2599 hsize_t get_storage_size(hid_t dset_id) 2600 { 2601 return H5Dget_storage_size(dset_id); 2602 } 2603 haddr_t get_offset(hid_t dset_id) 2604 { 2605 return H5Dget_offset(dset_id); 2606 } 2607 void read(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, hid_t plist_id, ubyte* buf/*out*/) 2608 { 2609 throwOnError(H5Dread(dset_id, mem_type_id, mem_space_id, file_space_id, plist_id,cast(void*)buf/*out*/)); 2610 } 2611 void write(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, hid_t plist_id, ubyte* buf) 2612 { 2613 throwOnError(H5Dwrite(dset_id, mem_type_id, mem_space_id, file_space_id, plist_id,cast(void*)buf)); 2614 } 2615 2616 void iterate(void *buf, hid_t type_id, hid_t space_id, H5D_operator_t op, void *operator_data) 2617 { 2618 throwOnError(H5Diterate(buf,type_id, space_id, op,operator_data)); 2619 } 2620 void vlen_reclaim(hid_t type_id, hid_t space_id, hid_t plist_id, void *buf) 2621 { 2622 throwOnError(H5Dvlen_reclaim(type_id, space_id, plist_id, buf)); 2623 } 2624 void vlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, hsize_t *size) 2625 { 2626 throwOnError(H5Dvlen_get_buf_size( dataset_id, type_id, space_id,size)); 2627 } 2628 void fill(const void *fill, hid_t fill_type, void *buf, hid_t buf_type, hid_t space) 2629 { 2630 throwOnError(H5Dfill(fill, fill_type, buf, buf_type, space)); 2631 } 2632 void set_extent(hid_t dset_id, const hsize_t size[]) 2633 { 2634 throwOnError(H5Dset_extent(dset_id, cast(hsize_t*)size)); 2635 } 2636 void scatter(H5D_scatter_func_t op, void *op_data, hid_t type_id, hid_t dst_space_id, void *dst_buf) 2637 { 2638 throwOnError(H5Dscatter(op, op_data, type_id, dst_space_id, dst_buf)); 2639 } 2640 void gather(hid_t src_space_id, const void *src_buf, hid_t type_id, size_t dst_buf_size, void *dst_buf, H5D_gather_func_t op, void *op_data) 2641 { 2642 throwOnError(H5Dgather(src_space_id, src_buf, type_id, dst_buf_size,dst_buf, op, op_data)); 2643 } 2644 void h5debug(hid_t dset_id) 2645 { 2646 throwOnError(H5Ddebug(dset_id)); 2647 } 2648 }// static 2649 } 2650 2651 struct H5F 2652 { 2653 static 2654 { 2655 htri_t is_hdf5(string filename) 2656 { 2657 return H5Fis_hdf5(toStringz(filename)); 2658 } 2659 2660 hid_t create(string filename, uint flags, hid_t create_plist, hid_t access_plist) 2661 { 2662 return H5Fcreate(toStringz(filename),flags,create_plist,access_plist); 2663 } 2664 2665 hid_t open(string filename, uint flags, hid_t access_plist) 2666 { 2667 return H5Fopen(toStringz(filename),flags,access_plist); 2668 } 2669 2670 2671 hid_t reopen(hid_t file_id) 2672 { 2673 return H5Freopen(file_id); 2674 } 2675 2676 2677 void flush(hid_t object_id, H5F_scope_t _scope) 2678 { 2679 throwOnError(H5Fflush(object_id,_scope)); 2680 } 2681 2682 2683 void close(hid_t file_id) 2684 { 2685 throwOnError(H5Fclose(file_id)); 2686 } 2687 2688 2689 hid_t get_create_plist(hid_t file_id) 2690 { 2691 return H5Fget_create_plist(file_id); 2692 } 2693 2694 2695 hid_t get_access_plist(hid_t file_id) 2696 { 2697 return H5Fget_access_plist(file_id); 2698 } 2699 2700 2701 void get_intent(hid_t file_id, uint * intent) 2702 { 2703 throwOnError(H5Fget_intent(file_id,intent)); 2704 } 2705 2706 2707 ssize_t get_obj_count(hid_t file_id, uint types) 2708 { 2709 return H5Fget_obj_count(file_id,types); 2710 } 2711 2712 2713 ssize_t get_obj_ids(hid_t file_id, uint types, size_t max_objs, hid_t *obj_id_list) 2714 { 2715 return H5Fget_obj_ids(file_id,types,max_objs,obj_id_list); 2716 } 2717 2718 2719 void get_vfd_handle(hid_t file_id, hid_t fapl, void **file_handle) 2720 { 2721 throwOnError(H5Fget_vfd_handle(file_id,fapl,file_handle)); 2722 } 2723 2724 2725 void mount(hid_t loc, string name, hid_t child, hid_t plist) 2726 { 2727 throwOnError(H5Fmount(loc,toStringz(name),child,plist)); 2728 } 2729 2730 2731 void unmount(hid_t loc, string name) 2732 { 2733 throwOnError(H5Funmount(loc,toStringz(name))); 2734 } 2735 2736 2737 hssize_t get_freespace(hid_t file_id) 2738 { 2739 return H5Fget_freespace(file_id); 2740 } 2741 2742 2743 void get_filesize(hid_t file_id, hsize_t *size) 2744 { 2745 throwOnError(H5Fget_filesize(file_id,size)); 2746 } 2747 2748 2749 ssize_t get_file_image(hid_t file_id, void * buf_ptr, size_t buf_len) 2750 { 2751 return H5Fget_file_image(file_id,buf_ptr,buf_len); 2752 } 2753 2754 2755 void get_mdc_hit_rate(hid_t file_id, double * hit_rate_ptr) 2756 { 2757 throwOnError(H5Fget_mdc_hit_rate(file_id,hit_rate_ptr)); 2758 } 2759 2760 2761 void get_mdc_size(hid_t file_id, size_t * max_size_ptr, size_t * min_clean_size_ptr, size_t * cur_size_ptr, int * cur_num_entries_ptr) 2762 { 2763 throwOnError(H5Fget_mdc_size(file_id,max_size_ptr,min_clean_size_ptr,cur_size_ptr,cur_num_entries_ptr)); 2764 } 2765 2766 2767 void reset_mdc_hit_rate_stats(hid_t file_id) 2768 { 2769 throwOnError(H5Freset_mdc_hit_rate_stats(file_id)); 2770 } 2771 2772 2773 ssize_t get_name(hid_t obj_id, char *name, size_t size) 2774 { 2775 return H5Fget_name(obj_id,name,size); 2776 } 2777 2778 2779 void get_info(hid_t obj_id, H5F_info_t *bh_info) 2780 { 2781 throwOnError(H5Fget_info(obj_id,bh_info)); 2782 } 2783 2784 2785 void clear_elink_file_cache(hid_t file_id) 2786 { 2787 throwOnError(H5Fclear_elink_file_cache(file_id)); 2788 } 2789 2790 2791 version(h5parallel) 2792 { 2793 void set_mpi_atomicity(hid_t file_id, hbool_t flag) 2794 { 2795 throwOnError(H5Fset_mpi_atomicity(file_id,flag)); 2796 } 2797 2798 2799 void get_mpi_atomicity(hid_t file_id, hbool_t *flag) 2800 { 2801 throwOnError(H5Fget_mpi_atomicity(file_id,flag)); 2802 } 2803 } 2804 }// static 2805 } 2806 2807 struct H5G 2808 { 2809 static 2810 { 2811 hid_t create2(hid_t loc_id, string name, hid_t lcpl_id, hid_t gcpl_id, hid_t gapl_id) 2812 { 2813 return H5Gcreate2(loc_id,toStringz(name),lcpl_id,gcpl_id,gapl_id); 2814 } 2815 2816 hid_t create_anon(hid_t loc_id, hid_t gcpl_id, hid_t gapl_id) 2817 { 2818 return H5Gcreate_anon(loc_id,gcpl_id,gapl_id); 2819 } 2820 2821 2822 hid_t open2(hid_t loc_id, string name, hid_t gapl_id) 2823 { 2824 return H5Gopen2(loc_id,toStringz(name),gapl_id); 2825 } 2826 2827 2828 hid_t get_create_plist(hid_t group_id) 2829 { 2830 return H5Gget_create_plist(group_id); 2831 } 2832 2833 2834 void get_info(hid_t loc_id, H5GInfo *ginfo) 2835 { 2836 throwOnError(H5Gget_info(loc_id,ginfo)); 2837 } 2838 2839 2840 void get_info_by_name(hid_t loc_id, string name, H5GInfo *ginfo, hid_t lapl_id) 2841 { 2842 throwOnError(H5Gget_info_by_name(loc_id,toStringz(name),ginfo,lapl_id)); 2843 } 2844 2845 2846 void get_info_by_idx(hid_t loc_id, string group_name, H5Index idx_type, H5IterOrder order, hsize_t n, H5GInfo *ginfo, hid_t lapl_id) 2847 { 2848 throwOnError(H5Gget_info_by_idx(loc_id,toStringz(group_name),idx_type,order,n,ginfo,lapl_id)); 2849 } 2850 2851 2852 void close(hid_t group_id) 2853 { 2854 throwOnError(H5Gclose(group_id)); 2855 } 2856 }//static 2857 } 2858 2859 struct H5I 2860 { 2861 static 2862 { 2863 hid_t register(H5IType type, const void *object) 2864 { 2865 return H5Iregister(type,object); 2866 } 2867 2868 2869 void *object_verify(hid_t id, H5IType id_type) 2870 { 2871 return H5Iobject_verify(id,id_type); 2872 } 2873 2874 2875 void *remove_verify(hid_t id, H5IType id_type) 2876 { 2877 return H5Iremove_verify(id,id_type); 2878 } 2879 2880 2881 H5IType get_type(hid_t id) 2882 { 2883 return H5Iget_type(id); 2884 } 2885 2886 2887 hid_t get_file_id(hid_t id) 2888 { 2889 return H5Iget_file_id(id); 2890 } 2891 2892 2893 string get_name(hid_t id) 2894 { 2895 char buf[2048]; 2896 if(H5Iget_name(id,cast(char*)buf,buf.length)<=0) 2897 return ""; 2898 else 2899 return ZtoString(buf[]); 2900 } 2901 2902 2903 int inc_ref(hid_t id) 2904 { 2905 return H5Iinc_ref(id); 2906 } 2907 2908 2909 int dec_ref(hid_t id) 2910 { 2911 return H5Idec_ref(id); 2912 } 2913 2914 2915 int get_ref(hid_t id) 2916 { 2917 return H5Iget_ref(id); 2918 } 2919 2920 2921 H5IType register_type(size_t hash_size, uint reserved, H5I_free_t free_func) 2922 { 2923 return H5Iregister_type(hash_size,reserved,free_func); 2924 } 2925 2926 2927 void clear_type(H5IType type, hbool_t force) 2928 { 2929 throwOnError(H5Iclear_type(type,force)); 2930 } 2931 2932 2933 void destroy_type(H5IType type) 2934 { 2935 throwOnError(H5Idestroy_type(type)); 2936 } 2937 2938 2939 int inc_type_ref(H5IType type) 2940 { 2941 return H5Iinc_type_ref(type); 2942 } 2943 2944 2945 int dec_type_ref(H5IType type) 2946 { 2947 return H5Idec_type_ref(type); 2948 } 2949 2950 2951 int get_type_ref(H5IType type) 2952 { 2953 return H5Iget_type_ref(type); 2954 } 2955 2956 2957 void *H5Isearch(H5IType type, H5I_search_func_t func, void *key) 2958 { 2959 return H5Isearch(type,func,key); 2960 } 2961 2962 2963 void nmembers(H5IType type, hsize_t *num_members) 2964 { 2965 throwOnError(H5Inmembers(type,num_members)); 2966 } 2967 2968 2969 htri_t type_exists(H5IType type) 2970 { 2971 return H5Itype_exists(type); 2972 } 2973 2974 2975 htri_t is_valid(hid_t id) 2976 { 2977 return H5Iis_valid(id); 2978 } 2979 }//static 2980 } 2981 struct H5L 2982 { 2983 static { 2984 void move(hid_t src_loc, string src_name, hid_t dst_loc, string dst_name, hid_t lcpl_id, hid_t lapl_id) 2985 { 2986 throwOnError(H5Lmove(src_loc,toStringz(src_name),dst_loc,toStringz(dst_name),lcpl_id,lapl_id)); 2987 } 2988 2989 2990 void copy(hid_t src_loc, string src_name, hid_t dst_loc, string dst_name, hid_t lcpl_id, hid_t lapl_id) 2991 { 2992 throwOnError(H5Lcopy(src_loc,toStringz(src_name),dst_loc,toStringz(dst_name),lcpl_id,lapl_id)); 2993 } 2994 2995 2996 void create_hard(hid_t cur_loc, string cur_name, hid_t dst_loc, string dst_name, hid_t lcpl_id, hid_t lapl_id) 2997 { 2998 throwOnError(H5Lcreate_hard(cur_loc,toStringz(cur_name),dst_loc,toStringz(dst_name),lcpl_id,lapl_id)); 2999 } 3000 3001 3002 void create_soft(string link_target, hid_t link_loc_id, string link_name, hid_t lcpl_id, hid_t lapl_id) 3003 { 3004 throwOnError(H5Lcreate_soft(toStringz(link_target),link_loc_id,toStringz(link_name),lcpl_id,lapl_id)); 3005 } 3006 3007 3008 void h5delete(hid_t loc_id, string name, hid_t lapl_id) 3009 { 3010 throwOnError(H5Ldelete(loc_id,toStringz(name),lapl_id)); 3011 } 3012 3013 3014 void delete_by_idx(hid_t loc_id, string group_name, H5Index idx_type, H5IterOrder order, hsize_t n, hid_t lapl_id) 3015 { 3016 throwOnError(H5Ldelete_by_idx(loc_id,toStringz(group_name), idx_type,order,n,lapl_id)); 3017 } 3018 3019 3020 void get_val(hid_t loc_id, string name, void *buf/*out*/, size_t size, hid_t lapl_id) 3021 { 3022 throwOnError(H5Lget_val( loc_id,toStringz(name), buf/*out*/, size, lapl_id)); 3023 } 3024 3025 3026 void get_val_by_idx(hid_t loc_id, string group_name, H5Index idx_type, H5IterOrder order, hsize_t n, void *buf/*out*/, size_t size, hid_t lapl_id) 3027 { 3028 throwOnError(H5Lget_val_by_idx(loc_id,toStringz(group_name),idx_type,order,n,buf/*out*/,size,lapl_id)); 3029 } 3030 3031 3032 htri_t exists(hid_t loc_id, string name, hid_t lapl_id) 3033 { 3034 return H5Lexists(loc_id,toStringz(name),lapl_id); 3035 } 3036 3037 3038 void get_info_by_idx(hid_t loc_id, string group_name, H5Index idx_type, H5IterOrder order, hsize_t n, H5LInfo *linfo /*out*/, hid_t lapl_id) 3039 { 3040 throwOnError(H5Lget_info_by_idx(loc_id,toStringz(group_name),idx_type,order,n,linfo,lapl_id)); 3041 } 3042 3043 3044 string get_name_by_idx(hid_t loc_id, string group_name, H5Index idx_type, H5IterOrder order, hsize_t n, hid_t lapl_id) 3045 { 3046 char[2048] buf; 3047 if (H5Lget_name_by_idx(loc_id,toStringz(group_name),idx_type,order,n,cast(char*)buf,buf.length,lapl_id)<=0) 3048 return ""; 3049 else 3050 { 3051 return ZtoString(buf[]); 3052 } 3053 } 3054 3055 void iterate(hid_t grp_id, H5Index idx_type, H5IterOrder order,H5L_iterate_t op) 3056 { 3057 throwOnError(H5Literate(grp_id,idx_type,order,cast(hsize_t*)0,op,cast(void*)0)); 3058 } 3059 3060 void iterate(hid_t grp_id, H5Index idx_type, H5IterOrder order, hsize_t *idx, H5L_iterate_t op, void *op_data) 3061 { 3062 throwOnError(H5Literate(grp_id,idx_type,order,idx,op,op_data)); 3063 } 3064 3065 void iterate_by_name(hid_t loc_id, string group_name, H5Index idx_type, H5IterOrder order, H5L_iterate_t op, hid_t lapl_id) 3066 { 3067 throwOnError(H5Literate_by_name(loc_id,toStringz(group_name),idx_type,order,cast(hsize_t*)0,op,cast(void*)0,lapl_id)); 3068 } 3069 3070 3071 void iterate_by_name(hid_t loc_id, string group_name, H5Index idx_type, H5IterOrder order, hsize_t *idx, H5L_iterate_t op, void *op_data, hid_t lapl_id) 3072 { 3073 throwOnError(H5Literate_by_name(loc_id,toStringz(group_name),idx_type,order,idx,op,op_data,lapl_id)); 3074 } 3075 3076 void visit(hid_t grp_id, H5Index idx_type, H5IterOrder order, H5L_iterate_t op, void *op_data) 3077 { 3078 throwOnError(H5Lvisit(grp_id, idx_type, order,op, op_data)); 3079 } 3080 3081 void visit_by_name(hid_t loc_id, string group_name, H5Index idx_type, H5IterOrder order, H5L_iterate_t op, void *op_data, hid_t lapl_id) 3082 { 3083 throwOnError(H5Lvisit_by_name(loc_id,toStringz(group_name),idx_type,order,op,op_data,lapl_id)); 3084 } 3085 3086 void create_ud(hid_t link_loc_id, string link_name, H5LType link_type, const void *udata, size_t udata_size, hid_t lcpl_id, hid_t lapl_id) 3087 { 3088 throwOnError(H5Lcreate_ud(link_loc_id,toStringz(link_name),link_type,udata,udata_size,lcpl_id,lapl_id)); 3089 } 3090 3091 3092 void register(const H5L_class_t *cls) 3093 { 3094 throwOnError(H5Lregister(cls)); 3095 } 3096 3097 3098 void unregister(H5LType id) 3099 { 3100 throwOnError(H5Lunregister(id)); 3101 } 3102 3103 3104 htri_t is_registered(H5LType id) 3105 { 3106 return H5Lis_registered(id); 3107 } 3108 3109 3110 string[2] unpack_elink_val(const void *ext_linkval/*in*/, size_t link_size, uint *flags) 3111 { 3112 char *filename; 3113 char *obj_path; 3114 throwOnError(H5Lunpack_elink_val(ext_linkval, link_size,flags,&filename,&obj_path)); 3115 return [ZtoString(filename),ZtoString(obj_path)]; 3116 } 3117 3118 3119 void create_external(string file_name, string obj_name, hid_t link_loc_id, string link_name, hid_t lcpl_id, hid_t lapl_id) 3120 { 3121 throwOnError(H5Lcreate_external(toStringz(file_name),toStringz(obj_name),link_loc_id,toStringz(link_name),lcpl_id,lapl_id)); 3122 } 3123 }//static 3124 } 3125 3126 struct H5O 3127 { 3128 static 3129 { 3130 hid_t open(hid_t loc_id, string name, hid_t lapl_id) 3131 { 3132 return H5Oopen(loc_id,toStringz(name),lapl_id); 3133 } 3134 3135 hid_t open_by_addr(hid_t loc_id, haddr_t addr) 3136 { 3137 return H5Oopen_by_addr(loc_id,addr); 3138 } 3139 3140 hid_t open_by_idx(hid_t loc_id, string group_name, H5Index idx_type, H5IterOrder order, hsize_t n, hid_t lapl_id) 3141 { 3142 return H5Oopen_by_idx(loc_id,toStringz(group_name),idx_type,order,n,lapl_id); 3143 } 3144 3145 htri_t exists_by_name(hid_t loc_id, string name, hid_t lapl_id) 3146 { 3147 return H5Oexists_by_name(loc_id,toStringz(name),lapl_id); 3148 } 3149 3150 void get_info(hid_t loc_id, H5O_info_t *oinfo) 3151 { 3152 throwOnError(H5Oget_info(loc_id,oinfo)); 3153 } 3154 3155 void get_info_by_name(hid_t loc_id, string name, H5O_info_t *oinfo, hid_t lapl_id) 3156 { 3157 //writefln("getinfobyname: %s",name); 3158 throwOnError(H5Oget_info_by_name(loc_id,toStringz(name),oinfo,lapl_id)); 3159 //writefln("passed throw"); 3160 } 3161 3162 3163 void get_info_by_idx(hid_t loc_id, string group_name, H5Index idx_type, H5IterOrder order, hsize_t n, H5O_info_t *oinfo, hid_t lapl_id) 3164 { 3165 throwOnError(H5Oget_info_by_idx(loc_id,toStringz(group_name),idx_type,order,n,oinfo,lapl_id)); 3166 } 3167 3168 void link(hid_t obj_id, hid_t new_loc_id, string new_name, hid_t lcpl_id, hid_t lapl_id) 3169 { 3170 throwOnError(H5Olink(obj_id,new_loc_id,toStringz(new_name),lcpl_id,lapl_id)); 3171 } 3172 3173 3174 void incr_refcount(hid_t object_id) 3175 { 3176 throwOnError(H5Oincr_refcount(object_id)); 3177 } 3178 3179 3180 void decr_refcount(hid_t object_id) 3181 { 3182 throwOnError(H5Odecr_refcount(object_id)); 3183 } 3184 3185 3186 void copy(hid_t src_loc_id, string src_name, hid_t dst_loc_id, string dst_name, hid_t ocpypl_id, hid_t lcpl_id) 3187 { 3188 throwOnError(H5Ocopy(src_loc_id,toStringz(src_name),dst_loc_id,toStringz(dst_name),ocpypl_id,lcpl_id)); 3189 } 3190 3191 3192 void set_comment(hid_t obj_id, string comment) 3193 { 3194 throwOnError(H5Oset_comment(obj_id,toStringz(comment))); 3195 } 3196 3197 3198 void set_comment_by_name(hid_t loc_id, string name, string comment, hid_t lapl_id) 3199 { 3200 throwOnError(H5Oset_comment_by_name(loc_id,toStringz(name),toStringz(comment),lapl_id)); 3201 } 3202 3203 3204 string get_comment(hid_t obj_id) 3205 { 3206 char[2048] buf; 3207 if (H5Oget_comment(obj_id,cast(char*)buf,buf.length)<=0) 3208 return ""; 3209 else 3210 return ZtoString(buf[]); 3211 } 3212 3213 3214 string get_comment_by_name(hid_t loc_id, string name, hid_t lapl_id) 3215 { 3216 char[2048] buf; 3217 if (H5Oget_comment_by_name(loc_id,toStringz(name),cast(char*)buf,buf.length,lapl_id)<=0) 3218 return ""; 3219 else 3220 return ZtoString(buf[]); 3221 } 3222 3223 3224 void visit(hid_t obj_id, H5Index idx_type, H5IterOrder order, H5O_iterate_t op, void *op_data) 3225 { 3226 throwOnError(H5Ovisit(obj_id,idx_type,order,op,op_data)); 3227 } 3228 3229 3230 void visit_by_name(hid_t loc_id, string obj_name, H5Index idx_type, H5IterOrder order, H5O_iterate_t op, void *op_data, hid_t lapl_id) 3231 { 3232 throwOnError(H5Ovisit_by_name(loc_id,toStringz(obj_name),idx_type,order,op,op_data,lapl_id)); 3233 } 3234 3235 3236 void close(hid_t object_id) 3237 { 3238 throwOnError(H5Oclose(object_id)); 3239 } 3240 }//static 3241 } 3242 3243 struct H5P 3244 { 3245 static 3246 { 3247 hid_t create_class(hid_t parent, string name, H5P_cls_create_func_t cls_create, void *create_data, H5P_cls_copy_func_t cls_copy, void *copy_data, H5P_cls_close_func_t cls_close, void *close_data) 3248 { 3249 return H5Pcreate_class(parent,toStringz(name),cls_create,create_data,cls_copy,copy_data,cls_close,close_data); 3250 } 3251 3252 3253 string get_class_name(hid_t pclass_id) 3254 { 3255 return ZtoString(H5Pget_class_name(pclass_id)); 3256 } 3257 3258 3259 hid_t create(hid_t cls_id) 3260 { 3261 return H5Pcreate(cls_id); 3262 } 3263 3264 3265 void register2(hid_t cls_id, string name, size_t size, void *def_value, H5P_prp_create_func_t prp_create, H5P_prp_set_func_t prp_set, H5P_prp_get_func_t prp_get, H5P_prp_delete_func_t prp_del, H5P_prp_copy_func_t prp_copy, H5P_prp_compare_func_t prp_cmp, H5P_prp_close_func_t prp_close) 3266 { 3267 throwOnError(H5Pregister2(cls_id,toStringz(name),size,def_value,prp_create,prp_set,prp_get,prp_del,prp_copy,prp_cmp,prp_close)); 3268 } 3269 3270 3271 void insert2(hid_t plist_id, string name, size_t size, void *value, H5P_prp_set_func_t prp_set, H5P_prp_get_func_t prp_get, H5P_prp_delete_func_t prp_delete, H5P_prp_copy_func_t prp_copy, H5P_prp_compare_func_t prp_cmp, H5P_prp_close_func_t prp_close) 3272 { 3273 throwOnError(H5Pinsert2(plist_id,toStringz(name),size,value,prp_set,prp_get,prp_delete,prp_copy,prp_cmp,prp_close)); 3274 } 3275 3276 3277 void set(hid_t plist_id, string name, string value) 3278 { 3279 void *buf=cast(void*)toStringz(value); 3280 throwOnError(H5Pset(plist_id,toStringz(name),buf)); 3281 } 3282 3283 3284 htri_t exist(hid_t plist_id, string name) 3285 { 3286 return H5Pexist(plist_id,toStringz(name)); 3287 } 3288 3289 3290 size_t get_size(hid_t id, string name) 3291 { 3292 size_t size; 3293 throwOnError(H5Pget_size(id,toStringz(name),&size)); 3294 return size; 3295 } 3296 3297 3298 size_t get_nprops(hid_t id) 3299 { 3300 size_t nprop; 3301 throwOnError(H5Pget_nprops(id,&nprop)); 3302 return nprop; 3303 } 3304 3305 3306 hid_t get_class(hid_t plist_id) 3307 { 3308 return H5Pget_class(plist_id); 3309 } 3310 3311 3312 hid_t get_class_parent(hid_t pclass_id) 3313 { 3314 return H5Pget_class_parent(pclass_id); 3315 } 3316 3317 3318 void get(hid_t plist_id, string name, void * value) 3319 { 3320 throwOnError(H5Pget(plist_id,toStringz(name),value)); 3321 } 3322 3323 3324 htri_t equal(hid_t id1, hid_t id2) 3325 { 3326 return H5Pequal(id1,id2); 3327 } 3328 3329 3330 htri_t isa_class(hid_t plist_id, hid_t pclass_id) 3331 { 3332 return H5Pisa_class(plist_id,pclass_id); 3333 } 3334 3335 3336 int iterate(hid_t id, int *idx, H5P_iterate_t iter_func, void *iter_data) 3337 { 3338 return H5Piterate(id,idx,iter_func,iter_data); 3339 } 3340 3341 3342 void copy_prop(hid_t dst_id, hid_t src_id, string name) 3343 { 3344 throwOnError(H5Pcopy_prop(dst_id,src_id,toStringz(name))); 3345 } 3346 3347 3348 void remove(hid_t plist_id, string name) 3349 { 3350 throwOnError(H5Premove(plist_id,toStringz(name))); 3351 } 3352 3353 3354 void unregister(hid_t pclass_id, string name) 3355 { 3356 throwOnError(H5Punregister(pclass_id,toStringz(name))); 3357 } 3358 3359 3360 void close_class(hid_t plist_id) 3361 { 3362 throwOnError(H5Pclose_class(plist_id)); 3363 } 3364 3365 3366 void close(hid_t plist_id) 3367 { 3368 throwOnError(H5Pclose(plist_id)); 3369 } 3370 3371 3372 hid_t copy(hid_t plist_id) 3373 { 3374 return H5Pcopy(plist_id); 3375 } 3376 3377 3378 void set_attr_phase_change(hid_t plist_id, uint max_compact, uint min_dense) 3379 { 3380 throwOnError(H5Pset_attr_phase_change(plist_id,max_compact,min_dense)); 3381 } 3382 3383 3384 void get_attr_phase_change(hid_t plist_id, uint *max_compact, uint *min_dense) 3385 { 3386 throwOnError(H5Pget_attr_phase_change(plist_id,max_compact,min_dense)); 3387 } 3388 3389 3390 void set_attr_creation_order(hid_t plist_id, uint crt_order_flags) 3391 { 3392 throwOnError(H5Pset_attr_creation_order(plist_id,crt_order_flags)); 3393 } 3394 3395 3396 void get_attr_creation_order(hid_t plist_id, uint *crt_order_flags) 3397 { 3398 throwOnError(H5Pget_attr_creation_order(plist_id,crt_order_flags)); 3399 } 3400 3401 3402 void set_obj_track_times(hid_t plist_id, hbool_t track_times) 3403 { 3404 throwOnError(H5Pset_obj_track_times(plist_id,track_times)); 3405 } 3406 3407 3408 hbool_t get_obj_track_times(hid_t plist_id) 3409 { 3410 hbool_t track_times; 3411 throwOnError(H5Pget_obj_track_times(plist_id,&track_times)); 3412 return track_times; 3413 } 3414 3415 3416 void modify_filter(hid_t plist_id, H5ZFilter filter, int flags, size_t cd_nelmts, const int[] cd_values) 3417 { 3418 throwOnError(H5Pmodify_filter(plist_id,filter,flags,cd_nelmts,cast(const int*)&cd_values)); 3419 } 3420 3421 3422 void set_filter(hid_t plist_id, H5ZFilter filter, int flags, size_t cd_nelmts, const int c_values[]) 3423 { 3424 throwOnError(H5Pset_filter(plist_id,filter,flags,cd_nelmts,cast(const int*)&c_values)); 3425 } 3426 3427 3428 int get_nfilters(hid_t plist_id) 3429 { 3430 return H5Pget_nfilters(plist_id); 3431 } 3432 3433 3434 H5ZFilter get_filter2(hid_t plist_id, uint filter, int *flags/*out*/, size_t *cd_nelmts/*out*/, uint cd_values[]/*out*/, size_t namelen, char name[], uint *filter_config /*out*/) 3435 { 3436 return H5Pget_filter2(plist_id,filter,flags/*out*/,cd_nelmts/*out*/,cast(uint*)&cd_values/*out*/,namelen,cast(char*)&name,filter_config); 3437 } 3438 3439 3440 void get_filter_by_id2(hid_t plist_id, H5ZFilter id, uint *flags/*out*/, size_t *cd_nelmts/*out*/, int cd_values[]/*out*/, size_t namelen, char name[]/*out*/, int *filter_config/*out*/) 3441 { 3442 throwOnError(H5Pget_filter_by_id2(plist_id,id,flags/*out*/,cd_nelmts/*out*/,cast(int*)&cd_values/*out*/,namelen,cast(char*)&name/*out*/,filter_config)); 3443 } 3444 3445 3446 htri_t all_filters_avail(hid_t plist_id) 3447 { 3448 return H5Pall_filters_avail(plist_id); 3449 } 3450 3451 3452 void remove_filter(hid_t plist_id, H5ZFilter filter) 3453 { 3454 throwOnError(H5Premove_filter(plist_id,filter)); 3455 } 3456 3457 3458 void set_deflate(hid_t plist_id, int aggression) 3459 { 3460 throwOnError(H5Pset_deflate(plist_id,aggression)); 3461 } 3462 3463 3464 void set_fletcher32(hid_t plist_id) 3465 { 3466 throwOnError(H5Pset_fletcher32(plist_id)); 3467 } 3468 3469 3470 void get_version(hid_t plist_id, uint *boot/*out*/, uint *freelist/*out*/, uint *stab/*out*/, uint *shhdr/*out*/) 3471 { 3472 throwOnError(H5Pget_version(plist_id,boot/*out*/,freelist/*out*/,stab/*out*/,shhdr/*out*/)); 3473 } 3474 3475 3476 void set_userblock(hid_t plist_id, hsize_t size) 3477 { 3478 throwOnError(H5Pset_userblock(plist_id,size)); 3479 } 3480 3481 3482 void get_userblock(hid_t plist_id, hsize_t *size) 3483 { 3484 throwOnError(H5Pget_userblock(plist_id,size)); 3485 } 3486 3487 3488 void set_sizes(hid_t plist_id, size_t sizeof_addr, size_t sizeof_size) 3489 { 3490 throwOnError(H5Pset_sizes(plist_id,sizeof_addr,sizeof_size)); 3491 } 3492 3493 3494 void get_sizes(hid_t plist_id, size_t *sizeof_addr/*out*/, size_t *sizeof_size/*out*/) 3495 { 3496 throwOnError(H5Pget_sizes(plist_id,sizeof_addr/*out*/,sizeof_size/*out*/)); 3497 } 3498 3499 3500 void set_sym_k(hid_t plist_id, uint ik, uint lk) 3501 { 3502 throwOnError(H5Pset_sym_k(plist_id,ik,lk)); 3503 } 3504 3505 3506 void get_sym_k(hid_t plist_id, uint *ik/*out*/, uint *lk/*out*/) 3507 { 3508 throwOnError(H5Pget_sym_k(plist_id,ik/*out*/,lk/*out*/)); 3509 } 3510 3511 3512 void set_istore_k(hid_t plist_id, uint ik) 3513 { 3514 throwOnError(H5Pset_istore_k(plist_id,ik)); 3515 } 3516 3517 3518 void get_istore_k(hid_t plist_id, uint *ik/*out*/) 3519 { 3520 throwOnError(H5Pget_istore_k(plist_id,ik/*out*/)); 3521 } 3522 3523 3524 void set_shared_mesg_nindexes(hid_t plist_id, uint nindexes) 3525 { 3526 throwOnError(H5Pset_shared_mesg_nindexes(plist_id,nindexes)); 3527 } 3528 3529 3530 void get_shared_mesg_nindexes(hid_t plist_id, uint *nindexes) 3531 { 3532 throwOnError(H5Pget_shared_mesg_nindexes(plist_id,nindexes)); 3533 } 3534 3535 3536 void set_shared_mesg_index(hid_t plist_id, uint index_num, uint mesg_type_flags, uint min_mesg_size) 3537 { 3538 throwOnError(H5Pset_shared_mesg_index(plist_id,index_num,mesg_type_flags,min_mesg_size)); 3539 } 3540 3541 3542 void get_shared_mesg_index(hid_t plist_id, uint index_num, uint *mesg_type_flags, uint *min_mesg_size) 3543 { 3544 throwOnError(H5Pget_shared_mesg_index(plist_id,index_num,mesg_type_flags,min_mesg_size)); 3545 } 3546 3547 3548 void set_shared_mesg_phase_change(hid_t plist_id, uint max_list, uint min_btree) 3549 { 3550 throwOnError(H5Pset_shared_mesg_phase_change(plist_id,max_list,min_btree)); 3551 } 3552 3553 3554 void get_shared_mesg_phase_change(hid_t plist_id, uint *max_list, uint *min_btree) 3555 { 3556 throwOnError(H5Pget_shared_mesg_phase_change(plist_id,max_list,min_btree)); 3557 } 3558 3559 3560 void set_alignment(hid_t fapl_id, hsize_t threshold, hsize_t alignment) 3561 { 3562 throwOnError(H5Pset_alignment(fapl_id,threshold,alignment)); 3563 } 3564 3565 3566 void get_alignment(hid_t fapl_id, hsize_t *threshold/*out*/, hsize_t *alignment/*out*/) 3567 { 3568 throwOnError(H5Pget_alignment(fapl_id,threshold/*out*/,alignment/*out*/)); 3569 } 3570 3571 3572 void set_driver(hid_t plist_id, hid_t driver_id, const void *driver_info) 3573 { 3574 throwOnError(H5Pset_driver(plist_id,driver_id,driver_info)); 3575 } 3576 3577 3578 hid_t get_driver(hid_t plist_id) 3579 { 3580 return H5Pget_driver(plist_id); 3581 } 3582 3583 3584 void *H5Pget_driver_info(hid_t plist_id) 3585 { 3586 return H5Pget_driver_info(plist_id); 3587 } 3588 3589 3590 void set_family_offset(hid_t fapl_id, hsize_t offset) 3591 { 3592 throwOnError(H5Pset_family_offset(fapl_id,offset)); 3593 } 3594 3595 3596 void get_family_offset(hid_t fapl_id, hsize_t *offset) 3597 { 3598 throwOnError(H5Pget_family_offset(fapl_id,offset)); 3599 } 3600 3601 3602 void set_cache(hid_t plist_id, int mdc_nelmts, size_t rdcc_nslots, size_t rdcc_nbytes, double rdcc_w0) 3603 { 3604 throwOnError(H5Pset_cache(plist_id,mdc_nelmts,rdcc_nslots,rdcc_nbytes,rdcc_w0)); 3605 } 3606 3607 3608 void get_cache(hid_t plist_id, int *mdc_nelmts, /* out */ size_t *rdcc_nslots/*out*/, size_t *rdcc_nbytes/*out*/, double *rdcc_w0) 3609 { 3610 throwOnError(H5Pget_cache(plist_id,mdc_nelmts,rdcc_nslots,rdcc_nbytes/*out*/,rdcc_w0)); 3611 } 3612 3613 3614 void set_gc_references(hid_t fapl_id, uint gc_ref) 3615 { 3616 throwOnError(H5Pset_gc_references(fapl_id,gc_ref)); 3617 } 3618 3619 3620 void get_gc_references(hid_t fapl_id, uint *gc_ref/*out*/) 3621 { 3622 throwOnError(H5Pget_gc_references(fapl_id,gc_ref/*out*/)); 3623 } 3624 3625 3626 void set_fclose_degree(hid_t fapl_id, H5F_close_degree_t degree) 3627 { 3628 throwOnError(H5Pset_fclose_degree(fapl_id,degree)); 3629 } 3630 3631 3632 void get_fclose_degree(hid_t fapl_id, H5F_close_degree_t *degree) 3633 { 3634 throwOnError(H5Pget_fclose_degree(fapl_id,degree)); 3635 } 3636 3637 3638 void set_meta_block_size(hid_t fapl_id, hsize_t size) 3639 { 3640 throwOnError(H5Pset_meta_block_size(fapl_id,size)); 3641 } 3642 3643 3644 void get_meta_block_size(hid_t fapl_id, hsize_t *size/*out*/) 3645 { 3646 throwOnError(H5Pget_meta_block_size(fapl_id,size/*out*/)); 3647 } 3648 3649 3650 void set_sieve_buf_size(hid_t fapl_id, size_t size) 3651 { 3652 throwOnError(H5Pset_sieve_buf_size(fapl_id,size)); 3653 } 3654 3655 3656 void get_sieve_buf_size(hid_t fapl_id, size_t *size/*out*/) 3657 { 3658 throwOnError(H5Pget_sieve_buf_size(fapl_id,size/*out*/)); 3659 } 3660 3661 3662 void set_small_data_block_size(hid_t fapl_id, hsize_t size) 3663 { 3664 throwOnError(H5Pset_small_data_block_size(fapl_id,size)); 3665 } 3666 3667 3668 void get_small_data_block_size(hid_t fapl_id, hsize_t *size/*out*/) 3669 { 3670 throwOnError(H5Pget_small_data_block_size(fapl_id,size/*out*/)); 3671 } 3672 3673 3674 void set_libver_bounds(hid_t plist_id, H5F_libver_t low, H5F_libver_t high) 3675 { 3676 throwOnError(H5Pset_libver_bounds(plist_id,low,high)); 3677 } 3678 3679 3680 void get_libver_bounds(hid_t plist_id, H5F_libver_t *low, H5F_libver_t *high) 3681 { 3682 throwOnError(H5Pget_libver_bounds(plist_id,low,high)); 3683 } 3684 3685 3686 void set_elink_file_cache_size(hid_t plist_id, uint efc_size) 3687 { 3688 throwOnError(H5Pset_elink_file_cache_size(plist_id,efc_size)); 3689 } 3690 3691 3692 void get_elink_file_cache_size(hid_t plist_id, uint *efc_size) 3693 { 3694 throwOnError(H5Pget_elink_file_cache_size(plist_id,efc_size)); 3695 } 3696 3697 3698 void set_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len) 3699 { 3700 throwOnError(H5Pset_file_image(fapl_id,buf_ptr,buf_len)); 3701 } 3702 3703 3704 void get_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr) 3705 { 3706 throwOnError(H5Pget_file_image(fapl_id,buf_ptr_ptr,buf_len_ptr)); 3707 } 3708 3709 3710 version(h5parallel) 3711 { 3712 void set_core_write_tracking(hid_t fapl_id, hbool_t is_enabled, size_t page_size) 3713 { 3714 throwOnError(H5Pset_core_write_tracking(fapl_id,is_enabled,page_size)); 3715 } 3716 3717 3718 void get_core_write_tracking(hid_t fapl_id, hbool_t *is_enabled, size_t *page_size) 3719 { 3720 throwOnError(H5Pget_core_write_tracking(fapl_id,is_enabled,page_size)); 3721 } 3722 } 3723 3724 void set_layout(hid_t plist_id, H5DLayout layout) 3725 { 3726 throwOnError(H5Pset_layout(plist_id,layout)); 3727 } 3728 3729 3730 H5DLayout get_layout(hid_t plist_id) 3731 { 3732 return H5Pget_layout(plist_id); 3733 } 3734 3735 3736 void set_chunk(hid_t plist_id, in hsize_t[] dims) 3737 { 3738 int ndims=cast(int)dims.length; 3739 throwOnError(H5Pset_chunk(plist_id,ndims,cast(const hsize_t*)dims)); 3740 } 3741 3742 3743 int get_chunk(hid_t plist_id, hsize_t[] dim/*out*/) 3744 { 3745 int max_ndims=to!int(dim.length); 3746 writefln("*MAX_ndims: %s",max_ndims); 3747 return H5Pget_chunk(plist_id,max_ndims,cast(hsize_t*)dim/*out*/); 3748 } 3749 3750 3751 void set_external(hid_t plist_id, string name, off_t offset, hsize_t size) 3752 { 3753 throwOnError(H5Pset_external(plist_id,toStringz(name),offset,size)); 3754 } 3755 3756 3757 int get_external_count(hid_t plist_id) 3758 { 3759 return H5Pget_external_count(plist_id); 3760 } 3761 3762 3763 void get_external(hid_t plist_id, uint idx, size_t name_size, char *name/*out*/, off_t *offset/*out*/, hsize_t *size/*out*/) 3764 { 3765 throwOnError(H5Pget_external(plist_id,idx,name_size,name/*out*/,offset/*out*/,size/*out*/)); 3766 } 3767 3768 3769 void set_szip(hid_t plist_id, uint options_mask, uint pixels_per_block) 3770 { 3771 throwOnError(H5Pset_szip(plist_id,options_mask,pixels_per_block)); 3772 } 3773 3774 3775 void set_shuffle(hid_t plist_id) 3776 { 3777 throwOnError(H5Pset_shuffle(plist_id)); 3778 } 3779 3780 3781 void set_nbit(hid_t plist_id) 3782 { 3783 throwOnError(H5Pset_nbit(plist_id)); 3784 } 3785 3786 3787 void set_scaleoffset(hid_t plist_id, H5Z_SO_scale_type_t scale_type, int scale_factor) 3788 { 3789 throwOnError(H5Pset_scaleoffset(plist_id,scale_type,scale_factor)); 3790 } 3791 3792 3793 void set_fill_value(hid_t plist_id, hid_t type_id, const void *value) 3794 { 3795 throwOnError(H5Pset_fill_value(plist_id,type_id,value)); 3796 } 3797 3798 3799 void get_fill_value(hid_t plist_id, hid_t type_id, void *value/*out*/) 3800 { 3801 throwOnError(H5Pget_fill_value(plist_id,type_id,value/*out*/)); 3802 } 3803 3804 3805 void fill_value_defined(hid_t plist, H5D_fill_value_t *status) 3806 { 3807 throwOnError(H5Pfill_value_defined(plist,status)); 3808 } 3809 3810 3811 void set_alloc_time(hid_t plist_id, H5DAllocTime alloc_time) 3812 { 3813 throwOnError(H5Pset_alloc_time(plist_id,alloc_time)); 3814 } 3815 3816 3817 void get_alloc_time(hid_t plist_id, H5DAllocTime *alloc_time/*out*/) 3818 { 3819 throwOnError(H5Pget_alloc_time(plist_id,alloc_time/*out*/)); 3820 } 3821 3822 3823 void set_fill_time(hid_t plist_id, H5D_fill_time_t fill_time) 3824 { 3825 throwOnError(H5Pset_fill_time(plist_id,fill_time)); 3826 } 3827 3828 3829 void get_fill_time(hid_t plist_id, H5D_fill_time_t *fill_time/*out*/) 3830 { 3831 throwOnError(H5Pget_fill_time(plist_id,fill_time/*out*/)); 3832 } 3833 3834 3835 void set_chunk_cache(hid_t dapl_id, size_t rdcc_nslots, size_t rdcc_nbytes, double rdcc_w0) 3836 { 3837 throwOnError(H5Pset_chunk_cache(dapl_id,rdcc_nslots,rdcc_nbytes,rdcc_w0)); 3838 } 3839 3840 3841 void get_chunk_cache(hid_t dapl_id, size_t *rdcc_nslots/*out*/, size_t *rdcc_nbytes/*out*/, double *rdcc_w0/*out*/) 3842 { 3843 throwOnError(H5Pget_chunk_cache(dapl_id,rdcc_nslots/*out*/,rdcc_nbytes/*out*/,rdcc_w0/*out*/)); 3844 } 3845 3846 3847 void set_data_transform(hid_t plist_id, string expression) 3848 { 3849 throwOnError(H5Pset_data_transform(plist_id,toStringz(expression))); 3850 } 3851 3852 3853 string get_data_transform(hid_t plist_id) 3854 { 3855 char[2048] buf; 3856 if (H5Pget_data_transform(plist_id,cast(char*)buf,buf.length)<=0) 3857 return ""; 3858 else 3859 return ZtoString(buf[]); 3860 } 3861 3862 3863 void set_buffer(hid_t plist_id, size_t size, void *tconv, void *bkg) 3864 { 3865 throwOnError(H5Pset_buffer(plist_id,size,tconv,bkg)); 3866 } 3867 3868 3869 size_t get_buffer(hid_t plist_id, void **tconv/*out*/, void **bkg/*out*/) 3870 { 3871 return H5Pget_buffer(plist_id,tconv/*out*/,bkg/*out*/); 3872 } 3873 3874 3875 void set_preserve(hid_t plist_id, hbool_t status) 3876 { 3877 throwOnError(H5Pset_preserve(plist_id,status)); 3878 } 3879 3880 3881 int get_preserve(hid_t plist_id) 3882 { 3883 return H5Pget_preserve(plist_id); 3884 } 3885 3886 3887 void set_edc_check(hid_t plist_id, H5Z_EDC_t check) 3888 { 3889 throwOnError(H5Pset_edc_check(plist_id,check)); 3890 } 3891 3892 3893 H5Z_EDC_t get_edc_check(hid_t plist_id) 3894 { 3895 return H5Pget_edc_check(plist_id); 3896 } 3897 3898 3899 void set_filter_callback(hid_t plist_id, H5Z_filter_func_t func, void* op_data) 3900 { 3901 throwOnError(H5Pset_filter_callback(plist_id,func,op_data)); 3902 } 3903 3904 3905 void set_btree_ratios(hid_t plist_id, double left, double middle, double right) 3906 { 3907 throwOnError(H5Pset_btree_ratios(plist_id,left,middle,right)); 3908 } 3909 3910 3911 void get_btree_ratios(hid_t plist_id, double *left/*out*/, double *middle/*out*/, double *right/*out*/) 3912 { 3913 throwOnError(H5Pget_btree_ratios(plist_id,left/*out*/,middle/*out*/,right/*out*/)); 3914 } 3915 3916 3917 void set_hyper_vector_size(hid_t fapl_id, size_t size) 3918 { 3919 throwOnError(H5Pset_hyper_vector_size(fapl_id,size)); 3920 } 3921 3922 3923 void get_hyper_vector_size(hid_t fapl_id, size_t *size/*out*/) 3924 { 3925 throwOnError(H5Pget_hyper_vector_size(fapl_id,size/*out*/)); 3926 } 3927 3928 3929 void set_type_conv_cb(hid_t dxpl_id, H5T_conv_except_func_t op, void* operate_data) 3930 { 3931 throwOnError(H5Pset_type_conv_cb(dxpl_id,op,operate_data)); 3932 } 3933 3934 3935 void get_type_conv_cb(hid_t dxpl_id, H5T_conv_except_func_t *op, void** operate_data) 3936 { 3937 throwOnError(H5Pget_type_conv_cb(dxpl_id,op,operate_data)); 3938 } 3939 3940 3941 version(h5parallel) 3942 { 3943 void get_mpio_actual_chunk_opt_mode(hid_t plist_id, H5D_mpio_actual_chunk_opt_mode_t *actual_chunk_opt_mode) 3944 { 3945 throwOnError(H5Pget_mpio_actual_chunk_opt_mode(plist_id,actual_chunk_opt_mode)); 3946 } 3947 3948 3949 void get_mpio_actual_io_mode(hid_t plist_id, H5D_mpio_actual_io_mode_t *actual_io_mode) 3950 { 3951 throwOnError(H5Pget_mpio_actual_io_mode(plist_id,actual_io_mode)); 3952 } 3953 3954 3955 void get_mpio_no_collective_cause(hid_t plist_id, uint32_t *local_no_collective_cause, uint32_t *global_no_collective_cause) 3956 { 3957 throwOnError(H5Pget_mpio_no_collective_cause(plist_id,local_no_collective_cause,global_no_collective_cause)); 3958 } 3959 } 3960 3961 void set_create_intermediate_group(hid_t plist_id, uint crt_intmd) 3962 { 3963 throwOnError(H5Pset_create_intermediate_group(plist_id,crt_intmd)); 3964 } 3965 3966 3967 void get_create_intermediate_group(hid_t plist_id, uint *crt_intmd /*out*/) 3968 { 3969 throwOnError(H5Pget_create_intermediate_group(plist_id,crt_intmd)); 3970 } 3971 3972 3973 void set_local_heap_size_hint(hid_t plist_id, size_t size_hint) 3974 { 3975 throwOnError(H5Pset_local_heap_size_hint(plist_id,size_hint)); 3976 } 3977 3978 3979 void get_local_heap_size_hint(hid_t plist_id, size_t *size_hint /*out*/) 3980 { 3981 throwOnError(H5Pget_local_heap_size_hint(plist_id,size_hint)); 3982 } 3983 3984 3985 void set_link_phase_change(hid_t plist_id, uint max_compact, uint min_dense) 3986 { 3987 throwOnError(H5Pset_link_phase_change(plist_id,max_compact,min_dense)); 3988 } 3989 3990 3991 void get_link_phase_change(hid_t plist_id, uint *max_compact /*out*/, uint *min_dense /*out*/) 3992 { 3993 throwOnError(H5Pget_link_phase_change(plist_id,max_compact,min_dense)); 3994 } 3995 3996 3997 void set_est_link_info(hid_t plist_id, uint est_num_entries, uint est_name_len) 3998 { 3999 throwOnError(H5Pset_est_link_info(plist_id,est_num_entries,est_name_len)); 4000 } 4001 4002 4003 void get_est_link_info(hid_t plist_id, uint *est_num_entries /* out */, uint *est_name_len /* out */) 4004 { 4005 throwOnError(H5Pget_est_link_info(plist_id,est_num_entries,est_name_len)); 4006 } 4007 4008 4009 void set_link_creation_order(hid_t plist_id, uint crt_order_flags) 4010 { 4011 throwOnError(H5Pset_link_creation_order(plist_id,crt_order_flags)); 4012 } 4013 4014 4015 void get_link_creation_order(hid_t plist_id, uint *crt_order_flags /* out */) 4016 { 4017 throwOnError(H5Pget_link_creation_order(plist_id,crt_order_flags)); 4018 } 4019 4020 4021 void set_char_encoding(hid_t plist_id, H5TCset encoding) 4022 { 4023 throwOnError(H5Pset_char_encoding(plist_id,encoding)); 4024 } 4025 4026 4027 void get_char_encoding(hid_t plist_id, H5TCset *encoding /*out*/) 4028 { 4029 throwOnError(H5Pget_char_encoding(plist_id,encoding)); 4030 } 4031 4032 4033 void set_nlinks(hid_t plist_id, size_t nlinks) 4034 { 4035 throwOnError(H5Pset_nlinks(plist_id,nlinks)); 4036 } 4037 4038 4039 void get_nlinks(hid_t plist_id, size_t *nlinks) 4040 { 4041 throwOnError(H5Pget_nlinks(plist_id,nlinks)); 4042 } 4043 4044 4045 void set_elink_prefix(hid_t plist_id, string prefix) 4046 { 4047 throwOnError(H5Pset_elink_prefix(plist_id,toStringz(prefix))); 4048 } 4049 4050 4051 string get_elink_prefix(hid_t plist_id) 4052 { 4053 char[2048] buf; 4054 if (H5Pget_elink_prefix(plist_id,cast(char*)buf,buf.length)<=0) 4055 return ""; 4056 else 4057 return ZtoString(buf[]); 4058 } 4059 4060 4061 hid_t get_elink_fapl(hid_t lapl_id) 4062 { 4063 return H5Pget_elink_fapl(lapl_id); 4064 } 4065 4066 4067 void set_elink_fapl(hid_t lapl_id, hid_t fapl_id) 4068 { 4069 throwOnError(H5Pset_elink_fapl(lapl_id,fapl_id)); 4070 } 4071 4072 4073 void set_elink_acc_flags(hid_t lapl_id, uint flags) 4074 { 4075 throwOnError(H5Pset_elink_acc_flags(lapl_id,flags)); 4076 } 4077 4078 4079 void get_elink_acc_flags(hid_t lapl_id, uint *flags) 4080 { 4081 throwOnError(H5Pget_elink_acc_flags(lapl_id,flags)); 4082 } 4083 4084 4085 void set_copy_object(hid_t plist_id, uint crt_intmd) 4086 { 4087 throwOnError(H5Pset_copy_object(plist_id,crt_intmd)); 4088 } 4089 4090 4091 void get_copy_object(hid_t plist_id, uint *crt_intmd /*out*/) 4092 { 4093 throwOnError(H5Pget_copy_object(plist_id,crt_intmd)); 4094 } 4095 4096 4097 void add_merge_committed_dtype_path(hid_t plist_id, string path) 4098 { 4099 throwOnError(H5Padd_merge_committed_dtype_path(plist_id,toStringz(path))); 4100 } 4101 4102 4103 void free_merge_committed_dtype_paths(hid_t plist_id) 4104 { 4105 throwOnError(H5Pfree_merge_committed_dtype_paths(plist_id)); 4106 } 4107 }//static 4108 } 4109 4110 struct H5R 4111 { 4112 static 4113 { 4114 void create(void *_ref, hid_t loc_id, string name, H5RType ref_type, hid_t space_id) 4115 { 4116 throwOnError(H5Rcreate(_ref, loc_id, toStringz(name),ref_type,space_id)); 4117 } 4118 hid_t dereference(hid_t dataset, H5RType ref_type, const void *_ref) 4119 { 4120 return H5Rdereference(dataset, ref_type, _ref); 4121 } 4122 hid_t get_region(hid_t dataset, H5RType ref_type, const void *_ref) 4123 { 4124 return H5Rget_region(dataset, ref_type, _ref); 4125 } 4126 string get_name(hid_t loc_id, H5RType ref_type, const void *_ref) 4127 { 4128 char[2048] buf; 4129 if (H5Rget_name(loc_id, ref_type,_ref,cast(char*)buf,buf.length-1)<=0) 4130 return ""; 4131 else 4132 return ZtoString(buf[]); 4133 } 4134 void get_obj_type2(hid_t id, H5RType ref_type, const void *_ref, H5OType *obj_type) 4135 { 4136 throwOnError(H5Rget_obj_type2( id, ref_type,_ref, obj_type)); 4137 } 4138 } // static 4139 } 4140 4141 struct H5S 4142 { 4143 static { 4144 hid_t create(H5SClass type) 4145 { 4146 return H5Screate(type); 4147 } 4148 4149 hid_t create_simple(in hsize_t[] dims) 4150 { 4151 auto maxdims=dims; 4152 return create_simple(dims, maxdims); 4153 } 4154 4155 hid_t create_simple(in hsize_t[] dims, in hsize_t[] maxdims) 4156 { 4157 if (maxdims.length!=dims.length) 4158 throw new Exception("H5S create_simple: maxdims="~to!string(maxdims.length)~" must be of same rank as dims="~to!string(dims.length)); 4159 return H5Screate_simple(cast(int)dims.length, cast(const hsize_t*) dims,cast(const hsize_t*) maxdims); 4160 } 4161 4162 void set_extent_simple(hid_t space_id, in hsize_t[] dims) 4163 { 4164 set_extent_simple(space_id,dims,dims); 4165 } 4166 4167 void set_extent_simple(hid_t space_id, in hsize_t[] dims,in hsize_t[] max) 4168 { 4169 const(hsize_t)[] maxarg=max; 4170 int rank=to!int(dims.length); 4171 if ((max.length==0) && (dims.length>0)) 4172 maxarg=dims; 4173 else 4174 { 4175 if (maxarg.length!=dims.length) 4176 throw new Exception("H5S: max dims "~to!string(maxarg.length)~" must be of same ranks as dims="~to!string(dims.length)); 4177 } 4178 throwOnError(H5Sset_extent_simple(space_id,to!int(dims.length),cast(const hsize_t*)dims,cast(const hsize_t*)maxarg)); 4179 } 4180 4181 4182 hid_t copy(hid_t space_id) 4183 { 4184 return H5Scopy(space_id); 4185 } 4186 4187 4188 void close(hid_t space_id) 4189 { 4190 throwOnError(H5Sclose(space_id)); 4191 } 4192 4193 4194 void encode(hid_t obj_id, void *buf, size_t *nalloc) 4195 { 4196 throwOnError(H5Sencode(obj_id,buf,nalloc)); 4197 } 4198 4199 4200 hid_t decode(const void *buf) 4201 { 4202 return H5Sdecode(buf); 4203 } 4204 4205 4206 hssize_t get_simple_extent_npoints(hid_t space_id) 4207 { 4208 return H5Sget_simple_extent_npoints(space_id); 4209 } 4210 4211 4212 int get_simple_extent_ndims(hid_t space_id) 4213 { 4214 return H5Sget_simple_extent_ndims(space_id); 4215 } 4216 4217 int get_simple_extent_dims(hid_t space_id, hsize_t[] dims) 4218 { 4219 hsize_t[] maxdims; 4220 maxdims.length=dims.length; 4221 return H5Sget_simple_extent_dims(space_id,cast(hsize_t*)dims,cast(hsize_t*)maxdims); 4222 } 4223 4224 4225 int get_simple_extent_dims(hid_t space_id, hsize_t[] dims, hsize_t[] maxdims) 4226 { 4227 return H5Sget_simple_extent_dims(space_id,cast(hsize_t*)dims,cast(hsize_t*)maxdims); 4228 } 4229 4230 4231 htri_t is_simple(hid_t space_id) 4232 { 4233 return H5Sis_simple(space_id); 4234 } 4235 4236 4237 hssize_t get_select_npoints(hid_t spaceid) 4238 { 4239 return H5Sget_select_npoints(spaceid); 4240 } 4241 4242 4243 void select_hyperslab(hid_t filespace, H5SSeloper op, in hsize_t[] start, in hsize_t[] count) 4244 { 4245 select_hyperslab(filespace, op, start, cast(hsize_t[])[], count, cast(hsize_t[])[]); 4246 } 4247 4248 void select_hyperslab(hid_t space_id, H5SSeloper op, in hsize_t[] start, in hsize_t[] _stride, in hsize_t[] count, in hsize_t[] _block) 4249 { 4250 throwOnError(H5Sselect_hyperslab(space_id,op,cast(const hsize_t*)start,cast(const hsize_t*) _stride,cast(const hsize_t*)count,cast(const hsize_t*)_block)); 4251 } 4252 4253 4254 version(h5parallel) 4255 { 4256 hid_t combine_hyperslab(hid_t space_id, H5SSeloper op, const hsize_t *start, const hsize_t *_stride, const hsize_t *count, const hsize_t *_block) 4257 { 4258 return H5Scombine_hyperslab(space_id,op,start,_stride,count,_block); 4259 } 4260 4261 4262 void select_select(hid_t space1_id, H5SSeloper op, hid_t space2_id) 4263 { 4264 throwOnError(H5Sselect_select(space1_id,op,space2_id)); 4265 } 4266 4267 4268 hid_t combine_select(hid_t space1_id, H5SSeloper op, hid_t space2_id) 4269 { 4270 return H5Scombine_select(space1_id,op,space2_id); 4271 } 4272 } 4273 4274 void select_elements(hid_t space_id, H5SSeloper op, size_t num_elem, const hsize_t *coord) 4275 { 4276 throwOnError(H5Sselect_elements(space_id,op,num_elem,coord)); 4277 } 4278 4279 4280 H5SClass get_simple_extent_type(hid_t space_id) 4281 { 4282 return H5Sget_simple_extent_type(space_id); 4283 } 4284 4285 4286 void set_extent_none(hid_t space_id) 4287 { 4288 throwOnError(H5Sset_extent_none(space_id)); 4289 } 4290 4291 4292 void extent_copy(hid_t dst_id,hid_t src_id) 4293 { 4294 throwOnError(H5Sextent_copy(dst_id,src_id)); 4295 } 4296 4297 4298 htri_t extent_equal(hid_t sid1, hid_t sid2) 4299 { 4300 return H5Sextent_equal(sid1,sid2); 4301 } 4302 4303 4304 void select_all(hid_t spaceid) 4305 { 4306 throwOnError(H5Sselect_all(spaceid)); 4307 } 4308 4309 4310 void select_none(hid_t spaceid) 4311 { 4312 throwOnError(H5Sselect_none(spaceid)); 4313 } 4314 4315 4316 void offset_simple(hid_t space_id, const hssize_t *offset) 4317 { 4318 throwOnError(H5Soffset_simple(space_id,offset)); 4319 } 4320 4321 4322 htri_t select_valid(hid_t spaceid) 4323 { 4324 return H5Sselect_valid(spaceid); 4325 } 4326 4327 4328 hssize_t get_select_hyper_nblocks(hid_t spaceid) 4329 { 4330 return H5Sget_select_hyper_nblocks(spaceid); 4331 } 4332 4333 4334 hssize_t get_select_elem_npoints(hid_t spaceid) 4335 { 4336 return H5Sget_select_elem_npoints(spaceid); 4337 } 4338 4339 4340 void get_select_hyper_blocklist(hid_t spaceid, hsize_t startblock, hsize_t numblocks, hsize_t *buf) 4341 { 4342 throwOnError(H5Sget_select_hyper_blocklist(spaceid,startblock,numblocks,buf)); 4343 } 4344 4345 4346 void get_select_elem_pointlist(hid_t spaceid, hsize_t startpoint, hsize_t numpoints, hsize_t *buf) 4347 { 4348 throwOnError(H5Sget_select_elem_pointlist(spaceid,startpoint,numpoints,buf)); 4349 } 4350 4351 4352 void get_select_bounds(hid_t spaceid, hsize_t *start, hsize_t *end) 4353 { 4354 throwOnError(H5Sget_select_bounds(spaceid,start,end)); 4355 } 4356 4357 4358 H5S_sel_type get_select_type(hid_t spaceid) 4359 { 4360 return H5Sget_select_type(spaceid); 4361 } 4362 }// static 4363 } 4364 4365 struct H5T 4366 { 4367 static hid_t create(H5TClass type, size_t size) 4368 { 4369 return H5Tcreate(type,size); 4370 } 4371 4372 4373 static hid_t copy(hid_t type_id) 4374 { 4375 return H5Tcopy(type_id); 4376 } 4377 4378 4379 static void close(hid_t type_id) 4380 { 4381 throwOnError(H5Tclose(type_id)); 4382 } 4383 4384 4385 static htri_t equal(hid_t type1_id, hid_t type2_id) 4386 { 4387 return H5Tequal(type1_id,type2_id); 4388 } 4389 4390 4391 static void lock(hid_t type_id) 4392 { 4393 throwOnError(H5Tlock(type_id)); 4394 } 4395 4396 4397 static void commit2(hid_t loc_id, string name, hid_t type_id, hid_t lcpl_id, hid_t tcpl_id, hid_t tapl_id) 4398 { 4399 throwOnError(H5Tcommit2(loc_id,toStringz(name),type_id,lcpl_id,tcpl_id,tapl_id)); 4400 } 4401 4402 4403 static hid_t open2(hid_t loc_id, string name, hid_t tapl_id) 4404 { 4405 return H5Topen2(loc_id,toStringz(name),tapl_id); 4406 } 4407 4408 4409 static void commit_anon(hid_t loc_id, hid_t type_id, hid_t tcpl_id, hid_t tapl_id) 4410 { 4411 throwOnError(H5Tcommit_anon(loc_id,type_id,tcpl_id,tapl_id)); 4412 } 4413 4414 4415 static hid_t get_create_plist(hid_t type_id) 4416 { 4417 return H5Tget_create_plist(type_id); 4418 } 4419 4420 4421 static htri_t committed(hid_t type_id) 4422 { 4423 return H5Tcommitted(type_id); 4424 } 4425 4426 4427 static void encode(hid_t obj_id, void *buf, size_t *nalloc) 4428 { 4429 throwOnError(H5Tencode(obj_id,buf,nalloc)); 4430 } 4431 4432 4433 static hid_t decode(const void *buf) 4434 { 4435 return H5Tdecode(buf); 4436 } 4437 4438 4439 static void insert(hid_t parent_id, string name, size_t offset, hid_t member_id) 4440 { 4441 throwOnError(H5Tinsert(parent_id,toStringz(name),offset,member_id)); 4442 } 4443 4444 4445 static void pack(hid_t type_id) 4446 { 4447 throwOnError(H5Tpack(type_id)); 4448 } 4449 4450 4451 static hid_t enum_create(hid_t base_id) 4452 { 4453 return H5Tenum_create(base_id); 4454 } 4455 4456 4457 static void enum_insert(hid_t type, string name, const void *value) 4458 { 4459 throwOnError(H5Tenum_insert(type,toStringz(name),value)); 4460 } 4461 4462 4463 static string enum_nameof(hid_t type, const void *value) 4464 { 4465 char[2048] buf; 4466 throwOnError(H5Tenum_nameof(type,value,cast(char*)buf,buf.length)); 4467 return ZtoString(buf[]); 4468 } 4469 4470 4471 static void enum_valueof(hid_t type, string name, void *value/*out*/) 4472 { 4473 throwOnError(H5Tenum_valueof(type,toStringz(name),value/*out*/)); 4474 } 4475 4476 4477 static hid_t vlen_create(hid_t base_id) 4478 { 4479 return H5Tvlen_create(base_id); 4480 } 4481 4482 4483 static hid_t array_create2(hid_t base_id, uint ndims, const hsize_t dim[/* ndims */]) 4484 { 4485 return H5Tarray_create2(base_id,ndims,dim); 4486 } 4487 4488 4489 static int get_array_ndims(hid_t type_id) 4490 { 4491 return H5Tget_array_ndims(type_id); 4492 } 4493 4494 4495 static int get_array_dims2(hid_t type_id, hsize_t[] dims) 4496 { 4497 return H5Tget_array_dims2(type_id,cast(hsize_t*)&dims); 4498 } 4499 4500 4501 static void set_tag(hid_t type, string tag) 4502 { 4503 throwOnError(H5Tset_tag(type,toStringz(tag))); 4504 } 4505 4506 4507 static string get_tag(hid_t type_id) 4508 { 4509 return ZtoString(H5Tget_tag(type_id)); 4510 } 4511 4512 4513 static hid_t get_super(hid_t type_id) 4514 { 4515 return H5Tget_super(type_id); 4516 } 4517 4518 4519 static H5TClass get_class(hid_t type_id) 4520 { 4521 return H5Tget_class(type_id); 4522 } 4523 4524 4525 static htri_t detect_class(hid_t type_id, H5TClass cls) 4526 { 4527 return H5Tdetect_class(type_id,cls); 4528 } 4529 4530 4531 static size_t get_size(hid_t type_id) 4532 { 4533 return H5Tget_size(type_id); 4534 } 4535 4536 4537 static H5TByteOrder get_order(hid_t type_id) 4538 { 4539 return H5Tget_order(type_id); 4540 } 4541 4542 4543 static size_t get_precision(hid_t type_id) 4544 { 4545 return H5Tget_precision(type_id); 4546 } 4547 4548 4549 static int get_offset(hid_t type_id) 4550 { 4551 return H5Tget_offset(type_id); 4552 } 4553 4554 4555 static void get_pad(hid_t type_id, H5T_pad_t *lsb/*out*/, H5T_pad_t *msb/*out*/) 4556 { 4557 throwOnError(H5Tget_pad(type_id,lsb/*out*/,msb/*out*/)); 4558 } 4559 4560 4561 static H5T_sign_t get_sign(hid_t type_id) 4562 { 4563 return H5Tget_sign(type_id); 4564 } 4565 4566 4567 static void get_fields(hid_t type_id, size_t *spos/*out*/, size_t *epos/*out*/, size_t *esize/*out*/, size_t *mpos/*out*/, size_t *msize/*out*/) 4568 { 4569 throwOnError(H5Tget_fields(type_id,spos/*out*/,epos/*out*/,esize/*out*/,mpos/*out*/,msize/*out*/)); 4570 } 4571 4572 4573 static size_t get_ebias(hid_t type_id) 4574 { 4575 return H5Tget_ebias(type_id); 4576 } 4577 4578 4579 static H5T_norm_t get_norm(hid_t type_id) 4580 { 4581 return H5Tget_norm(type_id); 4582 } 4583 4584 4585 static H5T_pad_t get_inpad(hid_t type_id) 4586 { 4587 return H5Tget_inpad(type_id); 4588 } 4589 4590 4591 static H5TString get_strpad(hid_t type_id) 4592 { 4593 return H5Tget_strpad(type_id); 4594 } 4595 4596 4597 static int get_nmembers(hid_t type_id) 4598 { 4599 return H5Tget_nmembers(type_id); 4600 } 4601 4602 4603 static string get_member_name(hid_t type_id, uint membno) 4604 { 4605 return ZtoString(H5Tget_member_name(type_id,membno)); 4606 } 4607 4608 4609 static int get_member_index(hid_t type_id, string name) 4610 { 4611 return H5Tget_member_index(type_id,toStringz(name)); 4612 } 4613 4614 4615 static size_t get_member_offset(hid_t type_id, uint membno) 4616 { 4617 return H5Tget_member_offset(type_id,membno); 4618 } 4619 4620 4621 static H5TClass get_member_class(hid_t type_id, uint membno) 4622 { 4623 return H5Tget_member_class(type_id,membno); 4624 } 4625 4626 4627 static hid_t get_member_type(hid_t type_id, uint membno) 4628 { 4629 return H5Tget_member_type(type_id,membno); 4630 } 4631 4632 4633 static void get_member_value(hid_t type_id, uint membno, void *value/*out*/) 4634 { 4635 throwOnError(H5Tget_member_value(type_id,membno,value/*out*/)); 4636 } 4637 4638 4639 static H5TCset get_cset(hid_t type_id) 4640 { 4641 return H5Tget_cset(type_id); 4642 } 4643 4644 4645 static htri_t is_variable_str(hid_t type_id) 4646 { 4647 return H5Tis_variable_str(type_id); 4648 } 4649 4650 4651 static hid_t get_native_type(hid_t type_id, H5TDirection direction) 4652 { 4653 return H5Tget_native_type(type_id,direction); 4654 } 4655 4656 4657 static void set_size(hid_t type_id, size_t size) 4658 { 4659 throwOnError(H5Tset_size(type_id,size)); 4660 } 4661 4662 4663 static void set_order(hid_t type_id, H5TByteOrder order) 4664 { 4665 throwOnError(H5Tset_order(type_id,order)); 4666 } 4667 4668 4669 static void set_precision(hid_t type_id, size_t prec) 4670 { 4671 throwOnError(H5Tset_precision(type_id,prec)); 4672 } 4673 4674 4675 static void set_offset(hid_t type_id, size_t offset) 4676 { 4677 throwOnError(H5Tset_offset(type_id,offset)); 4678 } 4679 4680 4681 static void set_pad(hid_t type_id, H5T_pad_t lsb, H5T_pad_t msb) 4682 { 4683 throwOnError(H5Tset_pad(type_id,lsb,msb)); 4684 } 4685 4686 4687 static void set_sign(hid_t type_id, H5T_sign_t sign) 4688 { 4689 throwOnError(H5Tset_sign(type_id,sign)); 4690 } 4691 4692 4693 static void set_fields(hid_t type_id, size_t spos, size_t epos, size_t esize, size_t mpos, size_t msize) 4694 { 4695 throwOnError(H5Tset_fields(type_id,spos,epos,esize,mpos,msize)); 4696 } 4697 4698 4699 static void set_ebias(hid_t type_id, size_t ebias) 4700 { 4701 throwOnError(H5Tset_ebias(type_id,ebias)); 4702 } 4703 4704 4705 static void set_norm(hid_t type_id, H5T_norm_t norm) 4706 { 4707 throwOnError(H5Tset_norm(type_id,norm)); 4708 } 4709 4710 4711 static void set_inpad(hid_t type_id, H5T_pad_t pad) 4712 { 4713 throwOnError(H5Tset_inpad(type_id,pad)); 4714 } 4715 4716 4717 static void set_cset(hid_t type_id, H5TCset cset) 4718 { 4719 throwOnError(H5Tset_cset(type_id,cset)); 4720 } 4721 4722 4723 static void set_strpad(hid_t type_id, H5TString strpad) 4724 { 4725 throwOnError(H5Tset_strpad(type_id,strpad)); 4726 } 4727 4728 4729 static void register(H5T_pers_t pers, string name, hid_t src_id, hid_t dst_id, H5T_conv_t func) 4730 { 4731 throwOnError(H5Tregister(pers,toStringz(name),src_id,dst_id,func)); 4732 } 4733 4734 4735 static void unregister(H5T_pers_t pers, string name, hid_t src_id, hid_t dst_id, H5T_conv_t func) 4736 { 4737 throwOnError(H5Tunregister(pers,toStringz(name),src_id,dst_id,func)); 4738 } 4739 4740 4741 static H5T_conv_t find(hid_t src_id, hid_t dst_id, H5T_cdata_t **pcdata) 4742 { 4743 return H5Tfind(src_id,dst_id,pcdata); 4744 } 4745 4746 4747 static htri_t compiler_conv(hid_t src_id, hid_t dst_id) 4748 { 4749 return H5Tcompiler_conv(src_id,dst_id); 4750 } 4751 4752 4753 static void convert(hid_t src_id, hid_t dst_id, size_t nelmts, void *buf, void *background, hid_t plist_id) 4754 { 4755 throwOnError(H5Tconvert(src_id,dst_id,nelmts,buf,background,plist_id)); 4756 } 4757 } 4758 4759 struct H5Z 4760 { 4761 static void register(const void *cls) 4762 { 4763 throwOnError(H5Zregister(cls)); 4764 } 4765 4766 static void unregister(H5ZFilter id) 4767 { 4768 throwOnError(id); 4769 } 4770 4771 static htri_t filter_avail(H5ZFilter id) 4772 { 4773 return H5Zfilter_avail(id); 4774 } 4775 static void get_filter_info(H5ZFilter filter, uint *filter_config_flags) 4776 { 4777 throwOnError(H5Zget_filter_info(filter, filter_config_flags)); 4778 } 4779 }